Hello there, I have a LocalScript I made where the script is supposed to change the TextLabel like this:
"R0jym has rolled 4"
However it does not seem to work, as the output keeps saying that it's an error and the script keeps considering the PlayerName as a string, how do I remedy this? Thanks for any help
local player = game:GetService("Players").LocalPlayer
local PlayerName = player.DisplayName
local RS = game:GetService("ReplicatedStorage")
local AnnounceEvent = RS:WaitForChild("AnnounceEvent")
local text = player.PlayerGui.Announce.TextLabel
local text2 = player.PlayerGui.Roll.TextLabel
local button = player.PlayerGui.Roll.TextButton
local value = player.PlayerGui.Roll.Value
button.MouseButton1Click:Connect(function()
text.Text = ..PlayerName 'has rolled '..text2.Text
AnnounceEvent:FireServer()
end)

1 comment
You should tell us your error message as it'll help us find a solution to your problem. I see a problem on line 12 you put two dots to the left of PlayerName while it should be on the right of PlayerName