im pretty new to scripting and im learning fe right now and im making a crappy game for practice
local script
local rs = game:GetService("ReplicatedStorage") local event = rs.events.RemoteEvent local bad = game.ReplicatedStorage.events:WaitForChild("RemoteEvent") local sp = script.Parent local int = sp:WaitForChild("IntValue") local hum = game.Players.LocalPlayer.Character.Humanoid local tex = game.StarterGui.ScreenGui:WaitForChild("TextLabel") function goo() tex.Text = "Faith in Humanity = "..int.Value end bad.OnClientEvent:Connect(goo)
script
game.Players.PlayerAdded:Connect(function(gof) game.ReplicatedStorage.events.RemoteEvent:FireClient() end)
game:GetService("Players").PlayerAdded:Connect(function(gof) game:GetService("ReplicatedStorage").events.RemoteEvent:FireClient(gof) end)
As stated above by incapaz, you didn't fire the event to the specific client. Therefore you need to add the client in the parameters of :FireClient(), you used "gof" as your client so it should be:
game:GetService("Players").PlayerAdded:Connect(function(gof) game:GetService("ReplicatedStorage").events.RemoteEvent:FireClient(gof) end)
Additionally in the local script on Line 7 you set the directory of the TextLabel to:
game.StarterGui.ScreenGui:WaitForChild("TextLabel")
StarterGui is cloned to the player when they respawn and is not the actual gui's that the player is seeing. You should instead use PlayerGui. It is located inside the player in game:GetService("Players"):
game:GetService("Players").LocalPlayer.PlayerGui.ScreenGui:WaitForChild("TextLabel")
Everything should work after this.