01 | local part = script.Parent |
02 |
03 | part.Touched:Connect( function (hit) |
04 | local view = hit.Parent:FindFirstChild( "Union" ) |
05 | if view then |
06 | script.Parent.Anchored = true |
07 | print ( "Player see" ) |
08 | else |
09 | print ( "player unsee" ) |
10 | script.Parent.Anchored = false |
11 | end |
12 | end ) |
i am scripting SCP 173 and in the output only "Player see" repeat while "Player unsee" works only when spawning
Try when a player touches it check if it is a player like elseif
01 | local part = script.Parent |
02 |
03 | part.Touched:Connect( function (hit) |
04 | local view = hit.Parent:FindFirstChild( "Union" ) |
05 | if view then |
06 | script.Parent.Anchored = true |
07 | print ( "Player see" ) |
08 | elseif not view then |
09 | print ( "player unsee" ) |
10 | script.Parent.Anchored = false |
11 | end |
12 | end ) |
If it errors let me know