rasm123z
(rasm123z)
April 20, 2024, 3:02pm
#1
Hello. I am trying to do something after a player touches the part, but it does not work. Literally just doesn’t work, I’m 99% sure this code should work.
Details:
It’s a script. not a localscript.
The script is under the part in the workspace.
Script itself
script.Parent.Touched:Connect(function(otherPart)
print(otherPart)
end)
Part Properties
And yet, nothing happens…
No prints in the client output or server output.
What am I missing?
2 Likes
2112Jay
(2112Jay)
April 20, 2024, 3:09pm
#2
Is CanTouch checked in the part the script is in.
2 Likes
The code works perfectly fine in my game.
However, you can try this modified script which gives a visual update instead of output.
print("Running")
script.Parent.Touched:Connect(function(otherPart)
script.Parent.BrickColor = BrickColor.random()
end)
print("Ended")
Let me know what happens!
rasm123z
(rasm123z)
April 20, 2024, 7:57pm
#4
Yep. Its enabled.
There is no reason at all for this to not work…
1 Like
rasm123z
(rasm123z)
April 20, 2024, 7:58pm
#5
It suddenly works… apparently restarting studio worked for some reason…?
Weird glitch. Anyway, thanks for the help bro!
1 Like
system
(system)
Closed
May 4, 2024, 7:59pm
#6
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.