Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

I need help with this ball script?

Asked by
CHATED 10
10 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.

I'm trying to make a ball that will go back to the starting position if you die or fall of it while it moves. Heres the current code.

function onTouched(hit)
 if not game.Players:GetPlayerFromCharacter(hit.Parent) then
   print("Humanoid is not touching the block")
   Workspace.Ball1.CFrame = CFrame.new(-1363.967, 247.54, 318.47)
  end
 end

script.Parent.Touched:connect(onTouched)

Answer this question