Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I make a GUI specific to one character?

I have a ScreenGui in StarterGui, and its Visible property is false by default. When an event is fired, I want it to be visible to the player that fired the event only. However, when the event fires it becomes visible to all players.

Should I be storing it in PlayerGui or something?

EDIT: This causes the gui to disappear on every player's screen. EM is off.

game.Workspace.StartLine.Touched:connect(function(p)
	if p.Parent.Name == "Car" then
		script.Parent.Visible = false
	end
end)

It's really confusing me because this code works for a different GUI.

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local chooseCar = ReplicatedStorage:WaitForChild("chooseCar1")
script.Parent.Visible = true

script.Parent.MouseButton1Click:connect(function(p)
	script.Parent.Visible = false
	chooseCar:Fire()
end)

4 comments

0

Filtering enabled.

0

What about it?

0

Enable it.

0

Wait don't listen to me...

1 answer

✓ Accepted answer

Pretty normal, every client will detect that touch.

One thing I don't understand is line 7 of script 2, you're doing chooseCar:Fire()

It should be either FireClient or FireServer (depending on client - server or reversed)

My answer would be to put a string value inside the car and giving it the name of the player.

Like this

game.Workspace.StartLine.Touched:connect(function(p)
    if p.Parent.Name == "Car" and p.Parent:FindFirstChild('Owner') and p.Parent:FindFirstChild('Owner').Value == game.Players.LocalPlayer.Name then
        script.Parent.Visible = false
    end
end)

4 comments

0

I'll try that, thanks. The :Fire() is to another local script. Dunno if I should be doing that but it seems to work anyway.

0

Are you using remote events?

0

Bindable

0

Hm, Okay, then :Fire can be correct (never use bndable events)

This discussion is preserved as it was. New answers, comments, and votes are closed.