So, I'm trying to experiment with IsInGroup, GetRankInGroup, and GetRoleInGroup. But for some reason I can't seem to get any of them to work. I looked at tutorials and tried doing it myself, but still nothing. As shown below on line 4, the IsInGroup shows when a colon is added. So any explanation as to why this won't work?
local Player = game.Players.LocalPlayer
function Touched(plr)
if Player:IsInGroup(3713839) then
print("Works!")
end
end
script.Parent.Touched:Connect(Touched)

7 comments
need: error message. i see your problem but you tell us too
23:11:06.118 - Workspace.Part.Script:4: attempt to index upvalue 'Player' (a nil value)
You're using the Touched event wrong. Look at what the parameter is on the wiki. Also, Player is nil because you can't reference a local player in a server-script. Local player only exist locally.
The touched event, I've used before and it worked. I put the code in the server script in a local script, but nothing,
Oof nevermind, the touched event doesn't work.
I would like to recommend you use game:GetService("Players") instead of game.Player.LocalPlayer. I can't remember of they're different things.
How would I make the function work? Even when I change the function to script.Parent.Touched:Connect(function(), it doesn't work.