while wait() do if (center-game.Players.LocalPlayer.Character.HumanoidRootPart.Position).magnitude <= radius then game.Workspace.Basketball.Handle.CFrame = game.Workspace.Neon_isHere.HumanoidRootPart.CFrame end end
I CANNOT figure this out for the life of me, (there are variables i just didnt put them in the thread.)
This won't loop? It's supposed to give it to me everytime i get in radius but it wont, it will only execute upon the first time being executed/played and wont every other time i get close. could somebody help me out a little?
Your problem is most likely the fact that you're not updating the 'center' variable as the loop runs. You mentioned that it is a ball, so it is most likely changing constantly. Move your variable definition for 'center' to the first line after "while wait() do" so that it constantly updates the variable as the loop runs.
It would look something like this:
while wait() do center = workspace.Ball.Position if (center-game.Players.LocalPlayer.Character.HumanoidRootPart.Position).magnitude <= radius then game.Workspace.Basketball.Handle.CFrame = game.Workspace.Neon_isHere.HumanoidRootPart.CFrame end end
I'm also assuming that 'center' is a Vector3 value defining some position and that 'radius' is a float value already pre-defined. If I'm wrong on either account, please adjust your script accordingly so that I'm not.