Idk why it won't work, but the title is the error I get on Line 17.
This is a ServerSide Script inside a Tool, and I'm trying to help other people on my game since it deals with stealing a basketball.. and the magnitude should help them so that whenever a person is close, they'll steal the ball.
local tool=script.Parent
tool.Handle.Touched:connect(function(hit)
local char=hit.Parent
if char:IsA("Accessory") then wait()
elseif char:FindFirstChild("Humanoid") and char:FindFirstChild("Torso") and tool.Parent:FindFirstChild("Torso") then
script.Disabled=true
if (tool.Parent.Torso.Position-tool.Handle.Position).magnitude>5 and char.Humanoid.PlatformStand==false then -- magnitude
char.Humanoid.PlatformStand=true
local s=script.Stand:Clone() s.Parent=char.Humanoid
s.Disabled=false
else
tool.Parent=workspace wait() tool.Parent=char
wait(1)
end
else
if (tool.Parent.Torso.Position-char.Torso.Position).magnitude<=5.5 then -- magnitude
tool.Parent=workspace wait() tool.Parent=char
wait(1)
end
end
wait(1)
script.Disabled=false
end)
Thanks,
LukeGabrieI aka EnergyBrickz
