I cannot show the whole entire script unfortunately but i can however show the typing and getting player img one Okay i know what your thinking "Where are you going with this??" well basically in short, i'm making a camping game and it is working but! It is only showing on the server instead of the client This is a Script not a local script Let me explain What text label in the server says On the server Player: The quick brown fox jumps over the lazy dog And this is the textlabel text on the client Label Here is the pictures Client
Server Okay on with that here's the code!
local function typing(text) --This will make a typing effect for i = 1,#text,1 do game.StarterGui.ScreenGui.Frame.TextLabel.Text = string.sub(text,1,i) local sound = Instance.new("Sound",game.ReplicatedStorage) sound.SoundId = "rbxassetid://515150941" sound.PlayOnRemove = true sound:Destroy() wait() end end --Note that these both are working but the client cannot see them local function getplayerimg() local headshotformat = Enum.ThumbnailType.HeadShot local thumb = Enum.ThumbnailSize.Size180x180 local randomPlayer = game.Players:GetPlayers()[math.random(1,#game.Players:GetPlayers())] local Userid = game.Players:GetUserIdFromNameAsync(randomPlayer.Name) local picture = game.Players:GetUserThumbnailAsync(Userid,headshotformat,thumb) game.StarterGui.ScreenGui.Frame.ImageLabel.Image = picture
This may be because i'm not using a Local script that's because i want others to be able to see the text Any help is appreciated!
First thing, in line 3, I noticed:
game.StarterGui.ScreenGui.Frame.TextLabel.Text = string.sub(text,1,i)
Just to clarify, if you want to update player's gui, don't index game.StarterGui as the contents of StarterGui gets copied to PlayerGui which is located in the Player name's folder.
There are two ways you can do this: First, by firing all Clients and then in a LocalScript doing the stuff. For eg:
--Script -- Instead of what you wrote on line 3, do: game.ReplicatedStorage.REMOVE_EVENT:FireAllClients(text) -- Change the name of ur RE --LocalScript inside ur TextLabel (which you mentioned in Line 3) game.ReplicatedStorage.REMOTE_EVENT.OnClientEvent:Connect(function(text) script.Parent.Text = string.sub(text, 1, i) end)
Another way is that you can loop through all the players and change their TextLabel Text:
-- Instead of what you wrote in line 3 local players = game.Players:GetPlayers() for i, v in pairs(players) do v:WaitForChild("PlayerGui"):WaitForChild("ScreenGui").Frame.TextLabel.Text = string.sub(text, 1, i) -- Change the name of ScreenGui to prevent infinite yield (If there are more gui named ScreenGui) end
I am not entirely sure if Method 2 will work, as I have not tested it in Studio.
Lemme know if it helps!