i was playing with my friend and he got to the gui part and it showed up for him and me aswell. so i need to figure out how to make it so it only shows for the player that triggered the gui
workspace.WishHimAGoodBirthday.ClickDetector.MouseClick:Connect(function() script.Parent.TextTransparency = 0.9 wait(.03) script.Parent.TextTransparency = 0.8 wait(.03) script.Parent.TextTransparency = 0.7 wait(.03) script.Parent.TextTransparency = 0.6 wait(.03) script.Parent.TextTransparency = 0.5 wait(.03) script.Parent.TextTransparency = 0.4 wait(.03) script.Parent.TextTransparency = 0.3 wait(.03) script.Parent.TextTransparency = 0.2 wait(.03) script.Parent.TextTransparency = 0.1 wait(.03) script.Parent.TextTransparency = 0.0 end)
You're going to need 2 scripts and a RemoteEvent (put the RemoteEvent in the ReplicatedStorage)
Server script (put this in the server script service)
local event = game.ReplicatedStorage:WaitForChild("RemoteEvent") local playerId = 000000 -- make this the UserId of the player that you want to see the GUI game.Players.PlayerAdded:Connect(function(player) player.CharacterAdded:Connect(function(char) if player.UserId == playerId then event:FireClient(player) end end) end)
Local script (put this in the TextLabel or whatever is inside the ScreenGui)
-- localscript local event = game.ReplicatedStorage:WaitForChild("RemoteEvent") local gui = script.Parent.Parent -- the ScreenGui object. gui.Enabled = false -- make everything that is part of ScreenGui invisible. event.OnClientEvent:Connect(function() gui.Enabled = true end)
Make sure to change these variables to actually match what they are in your game (playerId, gui location, etc).
Hope this helps!
EDIT: In response to you're comment:
Server script (ServerScriptService):
local endPart = workspace:WaitForChild("EndPart") local event = game.ReplicatedStorage:WaitForChild("RemoteEvent") endPart.Touched:Connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") then local player = game.Players:GetPlayerFromCharacter(hit.Parent) event:FireClient(player) end end)
The LocalScript should stay as it is.
Marked as Duplicate by killerbrenden, Cynical_Innovation, IAmNotTheReal_MePipe, and TaxesArentAwesome
This question has been asked before, and already has an answer. If those answers do not fully address your question, then please ask a new question here.
Why was this question closed?