local function cvChecker(character, ntClone)
if character:GetRankInGroup(13016143) > 0 then
print("rifles")
ntClone = riflesTag:Clone()
wait(.1)
ntClone.Parent = character:FindFirstChild("Head")
ntClone.Adornee = character:FindFirstChild("Head")
ntClone.playerName.Text = character.Name
ntClone.playerRank.Text = "<font color='#FF7276'> [Civillian], </font> "..playerRank
ntClone.Enabled = true
end
end
Into:
local function cvChecker(player, character, ntClone)
if player:GetRankInGroup(13016143) > 0 then
print("rifles")
ntClone = riflesTag:Clone()
wait(.1)
ntClone.Parent = character:FindFirstChild("Head")
ntClone.Adornee = character:FindFirstChild("Head")
ntClone.playerName.Text = character.Name
ntClone.playerRank.Text = "<font color='#FF7276'> [Civillian], </font> "..playerRank
ntClone.Enabled = true
end
end
Also, the first argument of OnServerEvent is always the player. From there on the rest of the arguments are the ones you actually passed through the function.
And for the way I’m getting the character from the client, I’m not really sure. I’m new to scripting and I kinda just put character there. That’s probably part of the issue. All I know is that character is defined like this:
local character = script.Parent
-earlier on in the script but I don’t think that affects what’s in function.
local function cvChecker(player, character, ntClone)
character = character or player.Character or player.CharacterAdded:Wait() -- // Making sure the character really exists.
if player:GetRankInGroup(13016143) > 0 then
print("rifles")
ntClone = riflesTag:Clone()
wait(.1)
ntClone.Parent = character:FindFirstChild("Head")
ntClone.Adornee = character:FindFirstChild("Head")
ntClone.playerName.Text = character.Name
ntClone.playerRank.Text = "<font color='#FF7276'> [Civillian], </font> "..playerRank
ntClone.Enabled = true
end
end