Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How would I send a bot back to a position when it touches a brick?

I have a bot, (model, that moves around and damages on touch). I want to make it when it touches a brick, it is sent back to the position it spawned in. I don't have much experience with this, so I could use some help. This is it so far.

model = Bot

script.Parent.Touched:connect(function(touched)
	if touched == model then
	touched.Position = UDim2.new() --position
end)

1 answer

✓ Accepted answer

You can't use UDim2 for 3D positioning. Instead you should be using Vector3.

In the end your code should look like this:

model = Bot

script.Parent.Touched:connect(function(touched)
    if touched == model then
    touched.Position = Vector3.new()--position
end
end)

1 comment

0

Didn't fully answer my question, but thanks for the advise.

This discussion is preserved as it was. New answers, comments, and votes are closed.