Hello, I am currently trying to create a simple game to learn how to script. I was wondering, what would I have to do so that when a brick is clicked, It teleports to a random location within a certain area. Any thoughts on how to do this?
Thanks.
You need a click detector and scripting knowledge to achieve this:
mouse click:
function(plr) plr.Character:MoveTo(yourPos) end
and connect it to ClickDetector.MouseClick
you should probably search it up or visit the dev hub.
anyways, use a click detector and detect when a player clicks
ClickDetector.MouseClick:Connect
Then, use some magic (vector3 or cframe) to teleport the part
Part.Position = Vector3.new(pos)
Part.CFrame = CFrame.new(pos)
boom you’ve got yourself a part that teleports when its clicked