Right here I have a script that changes textlabel.Text depending on what type of building is present on a grid. However the textlabel does not change. It was blank before the script and stayed blank after the script. print("Changed Text") does print out.
"print(building)" prints out "Miner" (a model)
"print(building.Name)" prints out "Miner" (a string)
textlabel = script.Parent
text = textlabel.Text
rp = game:GetService("ReplicatedStorage")
editevent = rp:WaitForChild("EditEvent")
localplayer = game.Players.LocalPlayer
editevent.OnClientEvent:connect(function(player, grid, typebuilding)
textlabel.Parent.Parent.Enabled = true
if player.Name == localplayer.Name then
local building = typebuilding.Value
print(building)
text = building.Name
print(building.Name)
print("Changed Text")
end
end)

2 comments
Thanks for your effort, but nothing changed. The thing is, I don't want this text to change for every single player. So that's why I included player in the parameters.
Also, it doesn't really matter if it's local or global.