local Arrow = script.Parent
local Click = Arrow:WaitForChild("Click")
Click.MouseClick:Connect(function(player,tool)
local Backpack = player:FindFirstChild("Backpack")
local randomStand = math.random(1,3) --1 to the number of stands you have
end
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("Stand1"):Clone()
Stand.Parent = Backpack
local plrstats = player:FindFirstChild("PlrStats")
if plrstats then
local currentstand = plrstats:FindFirstChild("Stand")
currentstand.value ="Stand1"
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("Stand2"):Clone()
Stand.Parent = Backpack
local plrstats = player:FindFirstChild("PlrStats")
if plrstats then
local currentstand = plrstats:FindFirstChild("Stand")
currentstand.value ="Stand2"
end
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("Stand3"):Clone()
Stand.Parent = Backpack
local plrstats = player:FindFirstChild("PlrStats")
if plrstats then
local currentstand = plrstats:FindFirstChild("Stand")
currentstand.value ="Stand3"
end
Arrow:Destroy()
end
end
end
Line 4
ERROR:Error: (12,2) Syntax error: Expected ')' (to close '(' at line 4), got 'if'

1 comment
Add a parenthesis at line 9 end)