function ot()
game.Workspace.Scootabot.TouchingWhat.Value = 1
end
script.Parent.Touched:connect(ot)
I have this function that sets TouchingWhat.Value to 1 when it's touched. The problem is, I don't want it to be able to be set off by a player. I want it so that only the AI walking towards the brick's part can activate the function. I already tried
local bot = script.Parent:FindFirstChild("Model")
if bot.Name = "Scootabot" then
but it came up with the conclusion that Scootakip (The NPC Model touching the block) is nil.
Can someone help me fix this incredibly annoying issue.

1 comment
Well, my script was correct, but if you don't like it ,that's fine.