Hey, I want to move a part randomly and after 5 secounds make it come back to it's place.I've thought at a way but idk if it will work.

function yeah(mouse)
	x = Instance.new("Part", Workspace)
	--x properties
	x.Touched:connect(function(Part)
		if Part.Parent:FindFirstChild("Humanoid")	== nil then
			y = Part.Position
			Part.Position = Part.Position + Vector3.new(math.random(-3, 3), 0, math.random(-3, 3))
			wait(5)
			Part.Position = y

Thanks!

3 comments

0

You are missing the endings for your functions.

0

It's not that, I wrote that here not in studio.

0

You have the code, why not test it yourself? Or do you mean, that's all the code you have so far, and you don't know how to finish the script?