part_position = 40.9, 8.35, -1.8
player = game.Players.LocalPlayer
game.Players:WaitForChild('LocalPlayer')
player:WaitForChild('Character')
if player.Character and (player.Character.Torso.Position-part_position).magnitude < 5 then
script.Parent.CanCollide = false
wait(5)
script.Parent.CanCollide = true
end
Idk where I went wrong

3 comments
The
WaitForChildfunction waits for an object. The Player may be and object, but in a localscript, you wont get the client that way: You have to do itPlayers.LocalPlayer. Same with the player's characterPlayers.LocalPlayer.Character.Another thing to note is that you set up
part_positionto be a Vector3, but you didn't translate the values into a vector. Just simply add the values into a Vector3 value.Vector3(x,y,z)http://wiki.roblox.com/index.php?title=API:Class/Players/LocalPlayer http://wiki.roblox.com/index.php?title=API:Class/Player/Character http://wiki.roblox.com/index.php?title=API:Class/LocalScript http://wiki.roblox.com/index.php?title=API:Vector3