Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- params : ...
- Player = game.Players.LocalPlayer
- enabled = true
- enabled1 = true
- Weapon = nil
- script.Parent.Parent.Parent:WaitForChild("RedCode")
- Redeem = script.Parent.Parent.Parent.RedCode.Value
- script.Parent.Parent.Parent.RedCode:remove()
- T = {}
- for u,c in pairs(script.Parent:GetChildren()) do
- if c.ClassName == "ImageLabel" then
- T[#T + 1] = c.Image
- end
- end
- for u,c in pairs(script.Parent.Parent:GetChildren()) do
- if c.ClassName == "ImageLabel" then
- T[#T + 1] = c.Image
- end
- end
- local ContentProvider = game:GetService("ContentProvider")
- local LoadAssets = function(AssetList)
- for _,AssetId in pairs(AssetList) do
- ContentProvider:Preload(AssetId)
- end
- end
- LoadAssets(T)
- FrewCloud = function()
- local a = nil
- if math.random(1, 2) == 1 then
- local Cloud = script.Parent.Parent.Cloud:Clone()
- Cloud.Parent = script.Parent.Parent
- Cloud.Visible = true
- Cloud.Position = UDim2.new(4.35, 0, 1, 0)
- game.Debris:AddItem(Cloud, 1.5)
- if math.random(1, 2) == 1 then
- a = -6
- else
- a = 14
- end
- Cloud:TweenPosition(UDim2.new(a, 0, math.random(-400, 800) / 100, 0))
- Cloud:TweenSize(UDim2.new(5.2, 0, 4, 0))
- else
- do
- local Cloud = script.Parent.Parent.Cloud:Clone()
- Cloud.Parent = script.Parent.Parent
- Cloud.Visible = true
- Cloud.Position = UDim2.new(4.35, 0, 1, 0)
- game.Debris:AddItem(Cloud, 1.5)
- if math.random(1, 2) == 1 then
- a = -6
- else
- a = 9
- end
- Cloud:TweenPosition(UDim2.new(math.random(-300, 1000) / 100, 0, a, 0))
- Cloud:TweenSize(UDim2.new(5.2, 0, 4, 0))
- end
- end
- end
- FinalButton = function(Weapon)
- script.Parent.Parent.Accept.MouseButton1Click:connect(function()
- if not enabled1 or enabled then
- return
- end
- enabled1 = false
- game.Workspace.RemoteEvents:FindFirstChild("ChangeVal"):FireServer(Player.TextureGui.TextureId.Weapon, Weapon)
- game.Workspace.RemoteEvents:FindFirstChild("GiveWeaponPrize"):FireServer(Weapon)
- game.Workspace.RemoteEvents:FindFirstChild("ChangeVal"):FireServer(Player.bin.Shop, false)
- game.Workspace.RemoteEvents:FindFirstChild("ChangeVal"):FireServer(Player.bin.Employment, false)
- game.Workspace.RemoteEvents:FindFirstChild("RemoveObject"):FireServer(script.Parent.Parent.Parent)
- end)
- script.Parent.Parent.Discard.MouseButton1Click:connect(function()
- if not enabled1 or enabled then
- return
- end
- enabled1 = false
- game.Workspace.RemoteEvents:FindFirstChild("ValueRiseOrCut"):FireServer(Player.TextureGui.TextureId.Beli, 3750, 1)
- game.Workspace.RemoteEvents:FindFirstChild("ChangeVal"):FireServer(Player.bin.Shop, false)
- game.Workspace.RemoteEvents:FindFirstChild("ChangeVal"):FireServer(Player.bin.Employment, false)
- script.Parent.CashOut:Play()
- script.Parent.Parent.Parent.Enabled = false
- wait(1)
- game.Workspace.RemoteEvents:FindFirstChild("RemoveObject"):FireServer(script.Parent.Parent.Parent)
- end)
- end
- onButtonClicked = function()
- if not enabled then
- return
- end
- enabled = false
- local RedeemCode = game.Workspace.RemoteEvents:FindFirstChild("DataBaseCheck"):InvokeServer("RedeemCode", "bin")
- if RedeemCode ~= Redeem then
- script.Parent.Parent.Parent:remove()
- print("Removed chest")
- end
- script.Parent.Parent.Parent.Text:remove()
- script.Parent.Parent.Text.Visible = true
- local rnd = 0
- local ClassName, Picture = nil, nil
- Weapon = "ImageLabel"
- for i = 1, 20 do
- for i = 1, 5 do
- wait(0.2 - i / 110)
- FrewCloud()
- end
- script.Parent.Sound:Play()
- if script.Parent:FindFirstChild(Weapon) then
- script.Parent:FindFirstChild(Weapon).Visible = false
- end
- math.randomseed(tick())
- for i = 1, 3 do
- rnd = math.random(1, 100)
- end
- if rnd < 7 then
- ClassName = "Legendary"
- Picture = Color3.fromRGB(245, 217, 0)
- else
- if rnd >= 7 and rnd < 27 then
- ClassName = "Famous"
- Picture = Color3.fromRGB(231, 71, 245)
- else
- if rnd >= 27 then
- ClassName = "Rare"
- Picture = Color3.fromRGB(47, 166, 245)
- end
- end
- end
- local rand = math.random(1, 93)
- if ClassName == "Legendary" then
- if rand < 18 then
- Weapon = "Newkama Kempo"
- else
- if rand >= 18 and rand < 36 then
- Weapon = "Double Vista`s Swords"
- else
- if rand >= 36 and rand < 54 then
- Weapon = "Shanks Saber"
- else
- if rand >= 54 and rand < 72 then
- Weapon = "Kitsunebi-ryu"
- else
- if rand >= 72 and rand < 89 then
- Weapon = "Rayleigh\'s Sword"
- else
- if rand >= 89 and rand < 92 then
- Weapon = "Yoru"
- else
- if rand >= 92 and rand < 95 then
- Weapon = "Shusui"
- else
- if rand >= 95 then
- Weapon = "Diable Jambe"
- end
- end
- end
- end
- end
- end
- end
- end
- else
- if ClassName == "Famous" then
- if rand < 10 then
- Weapon = "Om Sword"
- else
- if rand >= 10 and rand < 20 then
- Weapon = "Shiliew`s Nodati"
- else
- if rand >= 20 and rand < 30 then
- Weapon = "JaoKunDo"
- else
- if rand >= 30 and rand < 40 then
- Weapon = "Funkfreed"
- else
- if rand >= 40 and rand < 50 then
- Weapon = "Red Leg"
- else
- if rand >= 50 and rand < 60 then
- Weapon = "Oto and Kogarasi"
- else
- if rand >= 60 and rand < 70 then
- Weapon = "Hasshoken"
- else
- if rand >= 70 and rand < 80 then
- Weapon = "Ti Bon`s Sword"
- else
- if rand >= 80 and rand < 90 then
- Weapon = "Sandai Kitetsu"
- else
- if rand >= 90 and rand < 95 then
- Weapon = "Wado Ichimonji"
- else
- if rand >= 95 then
- Weapon = "Soul Solid"
- end
- end
- end
- end
- end
- end
- end
- end
- end
- end
- end
- else
- if ClassName == "Rare" then
- if rand < 10 then
- Weapon = "Kyros Longsword"
- else
- if rand >= 10 and rand < 20 then
- Weapon = "Jitte"
- else
- if rand >= 20 and rand < 30 then
- Weapon = "Kiribati"
- else
- if rand >= 30 and rand < 40 then
- Weapon = "Arlong`s Flintlock"
- else
- if rand >= 40 and rand < 50 then
- Weapon = "Mr. 5\'s Revolver"
- else
- if rand >= 50 and rand < 60 then
- Weapon = "Buggy`s Knifes"
- else
- if rand >= 60 and rand < 70 then
- Weapon = "Okama Kempo"
- else
- if rand >= 70 and rand < 80 then
- Weapon = "Axehand"
- else
- if rand >= 80 and rand < 90 then
- Weapon = "Alvida`s Iron Mace"
- else
- if rand >= 90 then
- Weapon = "Kuro Claws"
- end
- end
- end
- end
- end
- end
- end
- end
- end
- end
- end
- end
- end
- script.Parent.Parent.Text.Text = Weapon
- script.Parent.ImageColor3 = Picture
- if script.Parent:FindFirstChild(Weapon) then
- script.Parent:FindFirstChild(Weapon).Visible = true
- end
- script.Parent.Parent.Text.TextColor3 = Picture
- end
- script.Parent.Roll:Play()
- for i = 1, 100 do
- wait()
- FrewCloud()
- end
- script.Parent.Roll:Stop()
- script.Parent.OpenHihat:Play()
- if script.Parent:FindFirstChild(Weapon) then
- script.Parent:FindFirstChild(Weapon).Visible = false
- end
- math.randomseed(tick())
- for i = 1, 10 do
- rnd = math.random(1, 100)
- end
- if rnd < 3 then
- ClassName = "Legendary"
- Picture = Color3.fromRGB(245, 217, 0)
- else
- if rnd >= 3 and rnd < 19 then
- ClassName = "Famous"
- Picture = Color3.fromRGB(231, 71, 245)
- else
- if rnd >= 19 then
- ClassName = "Rare"
- Picture = Color3.fromRGB(47, 166, 245)
- end
- end
- end
- local rand = nil
- for i = 1, 10 do
- rand = math.random(1, 100)
- end
- if ClassName == "Legendary" then
- if rand < 18 then
- Weapon = "Newkama Kempo"
- else
- if rand >= 18 and rand < 36 then
- Weapon = "Double Vista`s Swords"
- if Player.TextureGui.TextureId.Race.Value == "Cyborg" then
- Weapon = "Reili`s Katana"
- end
- else
- if rand >= 36 and rand < 54 then
- Weapon = "Shanks Saber"
- else
- if rand >= 54 and rand < 72 then
- Weapon = "Kitsunebi-ryu"
- else
- if rand >= 72 and rand < 89 then
- Weapon = "Rayleigh\'s Sword"
- else
- if rand >= 89 and rand < 92 then
- Weapon = "Yoru"
- else
- if rand >= 92 and rand < 95 then
- Weapon = "Shusui"
- else
- if rand >= 95 then
- Weapon = "Diable Jambe"
- end
- end
- end
- end
- end
- end
- end
- end
- else
- if ClassName == "Famous" then
- if rand < 10 then
- Weapon = "Om Sword"
- else
- if rand >= 10 and rand < 20 then
- Weapon = "Shiliew`s Nodati"
- else
- if rand >= 20 and rand < 30 then
- Weapon = "JaoKunDo"
- else
- if rand >= 30 and rand < 40 then
- Weapon = "Funkfreed"
- else
- if rand >= 40 and rand < 50 then
- Weapon = "Red Leg"
- else
- if rand >= 50 and rand < 60 then
- Weapon = "Oto and Kogarasi"
- if Player.TextureGui.TextureId.Race.Value == "Cyborg" then
- Weapon = "Sandai Kitetsu"
- end
- else
- if rand >= 60 and rand < 70 then
- Weapon = "Hasshoken"
- else
- if rand >= 70 and rand < 80 then
- Weapon = "Ti Bon`s Sword"
- else
- if rand >= 80 and rand < 90 then
- Weapon = "Sandai Kitetsu"
- else
- if rand >= 90 and rand < 95 then
- Weapon = "Wado Ichimonji"
- else
- if rand >= 95 then
- Weapon = "Soul Solid"
- end
- end
- end
- end
- end
- end
- end
- end
- end
- end
- end
- else
- if ClassName == "Rare" then
- if rand < 10 then
- Weapon = "Kyros Longsword"
- else
- if rand >= 10 and rand < 20 then
- Weapon = "Jitte"
- else
- if rand >= 20 and rand < 30 then
- Weapon = "Kiribati"
- else
- if rand >= 30 and rand < 40 then
- Weapon = "Arlong`s Flintlock"
- else
- if rand >= 40 and rand < 50 then
- Weapon = "Mr. 5\'s Revolver"
- else
- if rand >= 50 and rand < 60 then
- Weapon = "Buggy`s Knifes"
- else
- if rand >= 60 and rand < 70 then
- Weapon = "Okama Kempo"
- else
- if rand >= 70 and rand < 80 then
- Weapon = "Axehand"
- else
- if rand >= 80 and rand < 90 then
- Weapon = "Alvida`s Iron Mace"
- else
- if rand >= 90 then
- Weapon = "Kuro Claws"
- if Player.TextureGui.TextureId.Race.Value == "Cyborg" then
- Weapon = "Axehand"
- end
- end
- end
- end
- end
- end
- end
- end
- end
- end
- end
- end
- end
- end
- script.Parent.ImageColor3 = Picture
- if script.Parent:FindFirstChild(Weapon) then
- script.Parent:FindFirstChild(Weapon).Visible = true
- end
- script.Parent.EndSound:Play()
- script.Parent.Parent.Text.TextColor3 = Picture
- script.Parent.Parent.Text.Text = Weapon
- script.Parent.Parent.Accept.Visible = true
- script.Parent.Parent.Discard.Visible = true
- FinalButton(Weapon)
- end
- script.Parent.MouseButton1Click:connect(onButtonClicked)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement