The part where we see the username of the player works fine, but i can not see the actual text.(this works fine locally but not publicly)
--public script game.ReplicatedStorage.OnEnter.OnServerEvent:Connect(function(x) for i,v in pairs(game.Players:GetChildren()) do v.PlayerGui.ScreenGui1.TextLabel.Text = x.PlayerGui.ScreenGui.TextBox.Text v.PlayerGui.ScreenGui1.TextLabel1.Text = x.Name end end) --local script script.Parent.MouseButton1Click:Connect(function() game.ReplicatedStorage.OnEnter:FireServer(game.Players.LocalPlayer) end)
The first thing that you're doing wrong is that you're attempting to send the LocalPlayer
over to the server, which is literally impossible to do. LocalPlayer
is strictly client-side only and cannot be replicated over the server/client boundary.
The second thing that you're doing wrong is that you're accessing the PlayerGui from the server. This can no longer be done because Roblox has removed Experimental Mode, which means that FE will always be on. You cannot disable it from under game
as it now appears as a dummy property and can no longer be toggled on or off.
Here is the fix to both of your scripts:
Server Script
local event = game:GetService("ReplicatedStorage"):WaitForChild("OnEnter") event:FireClient()
Local Script
local event = game:GetService("ReplicatedStorage"):WaitForChild("OnEnter") event.OnClientEvent:Connect(function(plr) for i, p in pairs(game.Players:GetPlayers()) do p.PlayerGui.ScreenGui1.TextLabel.Text = plr.PlayerGui.ScreenGui.TextBox.Text p.PlayerGui.ScreenGui1.TextLabel1.Text = plr.Name end end)