part.Touched Does not work as intended [repost] 2

i can tell it doesn’t work because when the model = nil the model.PrimaryPart does not exist

1 Like

Either way … you don’t put that line in a loop. It is basically setting up an interrupt that will fire on it’s own. The way you’re doing it now you’re creating a new interrupt with every stepped wait.

1 Like

Yeah, you’re right. Look at my edit.
Should probably add that you don’t reconnect the function if you’re setting Model to nil.

1 Like

i can tell it doesn’t work because when the model = nil the model.PrimaryPart does not exist

then all of the script doesn’t work!

1 Like

The connection will be automatically disconnected when the model is destroyed.

1 Like

oh i seen only now wait a minuite!

1 Like

Ok Works The Part above you edited, but doesn’t solve the problem where the model can’t detect walls and ceiling but only the character :slight_smile:

2 Likes

i even tried to get the model in replicated storage and then in workspace using the local script but it doesn’t work

1 Like

here’s what i mean:

the code works for the player but if you look the green template
it doesn’t say cannot touch part

1 Like