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..?
script.Parent.Touched:Connect(function(hit)
local plr = hit.Parent
game.Players(plr.Name):Destroy()
end)
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
local players = game:GetService("Players")
script.Parent.Touched:Connect(function(hit)
local plr = hit.Parent
local player1s = players:GetChildren()
if player1s.CharacterAppearanceId == plr.UserId then
player1s:Destroy()
end
end)

7 comments
that's not what im trying to do:(
Basically, line 2 is just getting the player from the part that touched the object the script is placed under. If it cannot get the player, that means it wasn't touching the character, it was touching something else (i.e. the baseplate). If it can get the player, then it continues to run by means of the if then function.
What are you trying to do?
under workspace in the directory, theres a category marked players, I want to know how to pick out a player if they touch a brick
I just did it...
i meant, i want to access their player in the players tab under workspace if they touch a brick
nevermind haha you were right i confused myself sorry