Group members only trail?

So I am trying to make a custom trail for my group but I don’t know how to make it so that only the members of my group can use it.

Code for Rank trail

wantedtrail = nil
script.Parent.MouseButton1Click:Connect(function()
if game.Players.LocalPlayer.leaderstats.Rank.Value >= 50 then
wantedtrail = “RainbowTrail”
workspace.Events.Trail:FireServer(wantedtrail)
end
end)

Use the :IsInGroup() function. Here is the API documentation:
https://developer.roblox.com/en-us/api-reference/function/Player/IsInGroup

1 Like