So I have this server script:

game.ReplicatedStorage.Sign.Confirm.OnServerEvent:Connect(function(player,cross)
	local signobject = player.Sign.Value
	game.Workspace:FindFirstChild(signobject).SurfaceGui.TextLabel.Text = player.SignItem.Value.." $"..cross
end)

When printing the values I need, it prints the correct value. However, it says "Attempt to index nil with SurfaceGui". When I use WaitForChild() instead of FindFirstChild(), it cannot find it because it does not exist for some reason. Can someone help me? And the error is not with the local script so you don't need to see that.

3 comments

0

maybe in this section: game.Workspace:FindFirstChild(signobject).SurfaceGui.TextLabel.Text

0

maybe do FindFirstChild(tostring(signobject))

0

Good idea, I'll try that.