I have a basketball game I made, and if the Spot is taken (Which has a value for that), then you shouldn't go on it. Well, when it's taken and you press "Join Court" it puts you on the pad and only that pad. The "_PadValue" is the pad number, I didn't want to name the pads like Pad1 or Pad2, so I just used a value for the pad, and all the pads name's are _Pad. Please help?
script.Parent.Join.MouseButton1Click:connect(function()
local player = game.Workspace:FindFirstChild(script.Parent.Parent.Parent.Name)
local plr = script.Parent.Parent.Parent
local court = script.Parent.Parent.Parent.Court.Value
local courtfind = game.Workspace._Court1
for i,v in pairs (courtfind._Team1:GetChildren()) do
local pad = tostring(v)
if v.Values._PadValue.Value==1 and v.Values._PadTaken.Value==false then
player.Torso.CFrame=CFrame.new(v.tpspot.Position)
script.Parent:Remove()
end
if v.Values._PadValue.Value==2 and v.Values._PadTaken.Value==false then
player.Torso.CFrame=CFrame.new(v.tpspot.Position)
script.Parent:Remove()
end
end
end)

2 comments
Thanks! it worked, now we can continue our game thanks to you, im sorry it's sloppy that is just how I lay my scripts out. Thanks bro!
No problem! Glad I could help :D