I've been working with this script for some time now and I can't seem to get it working for just one person. Whenever the script would run a certain part of it would appear for all people in the server rather than just one person (more specifications below the code). I believe it might have to do with the "if hit and hit.Parent and hit.Parent:FindFirstChild("Humanoid") then" line but i'm not quite sure edit it. Here is the script I have at this current point. Also I am quite new to scripting so if my script is quite unrefined or overall just messy and hard to understand sorry in advance.
Local Script in StarterGUI (since I want it to be for that specific person)
1.game.Workspace.ReflectanceLadder.AnchorPart.Touched:connect(function(hit) 2.if hit and hit.Parent and hit.Parent:FindFirstChild("Humanoid") then 3.for _, object in pairs(game.Workspace.ReflectanceLadder:GetChildren()) do 4.object.Anchored = false 5.if game.Workspace.ReflectanceLadder.AnchorPart.Anchored == false then 6.game.Workspace.ReflectanceSign.Transparency = 0 7.game.Workspace.ReflectanceSign.CanCollide = true 8.game.Workspace.ReflectanceSign.SurfaceGui.TextLabel.TextTransparency = 0 9.game.Workspace.ReflectanceSign.SurfaceGui.TextLabel.TextStrokeTransparency = 0 10.game.Workspace.ReflectanceSign2.Transparency = 0 11.game.Workspace.ReflectanceSign2.CanCollide = true 12.game.Workspace.ReflectanceSign2.SurfaceGui.TextLabel.TextTransparency = 0 13.game.Workspace.ReflectanceSign2.SurfaceGui.TextLabel.TextStrokeTransparency = 0 14.game.Workspace.ReflectanceSecretButton.Transparency = 0 15.game.StarterGui.ReflectanceSecret.Disabled = false 16.game.Workspace.ReflectanceSecretBlocker.CanCollide = false 17.end 18.end 19.end 20.end)
What's happening here is that when someone is climbing a ladder labeled as "ReflectanceLadder" and comes across a part named "AnchorPart" the person who touches it makes the whole ladder unanchor and breakdown. This part of the script works fine as the ladder doesn't break down for other people. After the ladder falls two signs and a button are meant to appear underneath the ladder labeled as "ReflectanceSign", "ReflectanceSign2" and "ReflectanceSecretButton" for the person who just went over that block and unanchored everything. The problem is that when someone would touch the block everyone could see the two signs and button at the bottom of the ladder which isn't my intention since I just want it for that specific person. If anyone has an answer to this problem I would like a solution. Thank you.