how could i access the player from a touched event?
Asked by
6 years ago Edited 6 years ago
i don't mean like the player model i mean the actual player in the players tab under workspace
if i started from script.Parent.Touched:Connect(function(hit)
i thought it might be this but this code doesn't work, it says retracee is not a valid member of players, even though I see myself in the players..?
1 | script.Parent.Touched:Connect( function (hit) |
3 | game.Players(plr.Name):Destroy() |
then I tried this but I got lost and didn't know how to access the player who had the Id, also it seems like it can't see my userid from a touched event because the logs say userid is not a valid member of model
01 | local players = game:GetService( "Players" ) |
03 | script.Parent.Touched:Connect( function (hit) |
04 | local plr = hit.Parent |
05 | local player 1 s = players:GetChildren() |
06 | if player 1 s.CharacterAppearanceId = = plr.UserId then |