I made a script but I keep getting a error in the output.
Workspace.Brick..Head.Script:4: attempt to index field 'Character' (a nil value)
script.Parent.Touched:connect(function(hit)
name = hit.Parent.Name
print(name.Character.userId)
end)
I made a script but I keep getting a error in the output.
Workspace.Brick..Head.Script:4: attempt to index field 'Character' (a nil value)
script.Parent.Touched:connect(function(hit)
name = hit.Parent.Name
print(name.Character.userId)
end)
Try this;
local debounce=false
script.Parent.Touched:connect(function(hit)
if not debounce then
debounce=true
plr=game.Players:GetPlayerFromCharacter(hit.Parent)
print(plr.Character.Name)
end
wait(2)
debounce=false
end)
I hope this helped!
This discussion is preserved as it was. New answers, comments, and votes are closed.