My script is supposed to send a bot back to its spawning position when it touches this brick. I set a variable as it's name, so it checks for the bot's name. If it's that name, (Bot), it sends it back to that position. My problem is, I get this error "Workspace.BotArea.InvisibleBlock.BotMove:7: attempt to index global 'model' (a nil value)" and I don't now why. Help?
model = Bot
spawnPos = Vector3.new(36.89, 3, -114)
script.Parent.Touched:connect(function(touched)
if model:findFirstChild(touched.Name, true) then
bot.Torso.CFrame = CFrame.new(spawnPos)
end
end)
