Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --// Arrow Script
- local Arrow = script.Parent
- local Click = Arrow:WaitForChild("Click")
- Click.MouseClick:Connect(function(player)
- local Backpack = player:FindFirstChild("Backpack")
- local randomStand = math.random(1,3) --1 to the number of stands you have
- if Backpack then
- if randomStand == 1 then
- local Stands = game:GetService("ServerStorage"):WaitForChild("Stands")
- --//If stand is summoned
- local prevStand = workspace:FindFirstChild(player.Name.." Stand")
- if prevStand then
- prevStand:Destroy()
- end
- for i, v in pairs(Backpack:GetChildren()) do
- if v:IsA("Folder") then
- local StandSummon = v:FindFirstChild("StandSummon")
- if StandSummon then
- v:Destroy()
- end
- end
- end
- --//Stand will be given
- local Stand = Stands:FindFirstChild("Star"):Clone()
- Stand.Parent = Backpack
- Arrow:Destroy()
- elseif randomStand == 2 then
- local Stands = game:GetService("ServerStorage"):WaitForChild("Stands")
- --//If stand is summoned
- local prevStand = workspace:FindFirstChild(player.Name.." Stand")
- if prevStand then
- prevStand:Destroy()
- end
- for i, v in pairs(Backpack:GetChildren()) do
- if v:IsA("Folder") then
- local StandSummon = v:FindFirstChild("StandSummon")
- if StandSummon then
- v:Destroy()
- end
- end
- end
- --//Stand will be given
- local Stand = Stands:FindFirstChild("Stand1"):Clone()
- Stand.Parent = Backpack
- Arrow:Destroy()
- elseif randomStand == 3 then
- local Stands = game:GetService("ServerStorage"):WaitForChild("Stands")
- --//If stand is summoned
- local prevStand = workspace:FindFirstChild(player.Name.." Stand")
- if prevStand then
- prevStand:Destroy()
- end
- for i, v in pairs(Backpack:GetChildren()) do
- if v:IsA("Folder") then
- local StandSummon = v:FindFirstChild("StandSummon")
- if StandSummon then
- v:Destroy()
- end
- end
- end
- --//Stand will be given
- local Stand = Stands:FindFirstChild("Platinum"):Clone()
- Stand.Parent = Backpack
- Arrow:Destroy()
- end
- end
- end)
- --//Rokaka Fruit
- local Fruit = script.Parent
- local Click = Fruit:WaitForChild("Click")
- Click.MouseClick:Connect(function(player)
- local Backpack = player:FindFirstChild("Backpack")
- if Backpack then
- --//If stand is summoned
- local prevStand = workspace:FindFirstChild(player.Name.." Stand")
- if prevStand then
- prevStand:Destroy()
- end
- --//Removes the Stand's Folder
- for i, v in pairs(Backpack:GetChildren()) do
- if v:IsA("Folder") then
- local StandSummon = v:FindFirstChild("StandSummon")
- if StandSummon then
- v:Destroy()
- end
- end
- end
- Fruit:Destroy()
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement