I am trying to make it so a “LastName” value from the LocalPlayer can be put onto a players nametag from a belt they can equip in-game, this is my current script;
local Players = game:GetService("Players")
local plr = game.Players.PlayerAdded
local namevalue = plr:WaitForChild("LastName")
local giver = script.Parent.Parent.Parent.Parent.Parent:WaitForChild("Giver")
game.Players.PlayerAdded:Connect(function(plr)
script.Parent.Text = plr:WaitForChild("LastName").Value
end)
giver.Touched:Connect(function(plr)
script.Parent.Text = plr:WaitForChild("LastName").Value
end)
An error I have received is this; WaitForChild is not a valid member of RBXScriptSignal
Which from research, means I cannot use a “WaitForChild” with a RBXScriptSignal.
PlayerAdded is a function that is to be fired upon a player joining. This in turn would not work at all, as you are trying to bind a yield (instance) function to a function, which can only be tied to instances.
anyways, change that to Players.LocalPlayer since Players variable was already set (and wasn’t even used) and PlayerAdded is an event, it wouldn’t return a player like what LocalPlayer does