Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to make this visible only to the person who touched the part?

Asked by 9 years ago

I made a localscript, which makes a frame visible. But, it becomes visible for everyone. Any ideas how to make it only for the player touching the part? I tried to make it's parent to LocalPlayer's PlayerGui, but it doesn't work

Code:

01game.Workspace.Story.Touched:connect(function(hit)
02    local human = hit.Parent:FindFirstChild("Humanoid")
03    if human ~=nil then
04        human.WalkSpeed = 0
05    end
06    local swoosh = script.Parent.Parent.Parent.Sound2
07    swoosh:Play()
08    wait(0.3)
09    script.Parent.Visible = true
10end)
0
Is this in a SurfaceGui? ISellCows 2 — 9y
0
No, ScreenGui. Director1406 5 — 9y

1 answer

Log in to vote
0
Answered by 9 years ago

It might be because the screengui is in the workspace. You might want to have the screen gui appear in game.Players['Player's Name'].PlayerGui

Ad

Answer this question