I want to change the text of a TextLabel but I can’t it’s like it just skips the line
Here’s my code:
local WinnersRemote = game.ReplicatedStorage.Winners
local WinnersUI = script.Parent
WinnersUI.Visible = false
WinnersRemote.OnClientEvent:Connect(function(winners)
print(string.format("The winners are: %s", winners)) -- prints "The winners are: GenericsAccount"
WinnersUI.Text = string.format("The winners are: %s", winners) -- doesn't change the text
WinnersUI.Visible = true
task.wait(5)
WinnersUI.Visible = false
end)
This is in a LocalScript in StarterGui, with the TextLabel as the parent of the localscript.
Y_VRN
(Y_VRNDLL)
July 27, 2023, 9:17am
#2
Your code is functional, nothing wrong with it. Is your TextLabel directly under StarterGui, or is it under a ScreenGui?
1 Like
It’s in a ScreenGui. Gaming in roblox have the character limiting even though.
Y_VRN
(Y_VRNDLL)
July 27, 2023, 9:54am
#4
Can you provide a snippet of your server code? Specifically the part where it fires FireClient(player)
or FireAllClients()
.
Okay, I’ll boot up my pc and provide it.
However I don’t think that’s the issue as the value is getting passed on, as the print()
statement works, and that the gui appears when fired.
Do you still need the server-side code?
Y_VRN
(Y_VRNDLL)
July 27, 2023, 9:59am
#6
I’m not sure. How is your UI set up, and what does it look like?
2 Likes
It is at the top of the screen and each time the remote event gets fired, it appears, should change the text, and then it disappears after 5 seconds.
Y_VRN
(Y_VRNDLL)
July 27, 2023, 10:02am
#8
What text does it display (currently)? In the server code, what are you sending to the clients?
1 Like
The text displays this:
Even though, at the bottom right, the Text proprety says “The winners are: GenericsAccount”
And I am sending this to the clients:
WinnersRemote:FireAllClients(table.concat(winners, ", "))
LoosersRemote:FireAllClients(table.concat(loosers, ", "))
Y_VRN
(Y_VRNDLL)
July 27, 2023, 10:14am
#10
Do the winners
and loosers
tables hold Player objects? Can you send more of your server code?
1 Like
As I’ve already told you, yes. It sends the data correctly, and it prints the data correctly on both sides.
Turns out I had TextWrapped enabled. I though it would add a newline if it went out of borders but no it just deletes the text.
1 Like
system
(system)
Closed
August 10, 2023, 10:19am
#12
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.