EDIT Just had to change GetRoleInGroup to GetRankInGroup. ^^
Hello ScriptingHelpers.
I just created a script to see that it is not working. My script is supposed to give a taser and a railgun to the people in the required roll in the group which is 12 and above. These are the trainers.
When I run the script, I get this error on line 4:- attempt to compare number with string
Here is the script:- ( Ps, not sure if the green bits are true. I wrote them as accurately as possible. )
game.Players.PlayerAdded:connect(function(p) -- Sees if a player joins. p.CharacterAdded:connect(function() -- When the character is added. RN = p:GetRoleInGroup(1240173) -- Sees if the player is in the group. if RN >= 12 then -- If the player is in the roll 12 or above (trainer). game.ServerStorage.Taser:Clone().Parent = p.Backpack -- Gives tools. game.ServerStorage.Railgun:Clone().Parent = p.Backpack -- Gives tools. end end) end)
Thanks if you helped! :]
game.Players.PlayerAdded:connect(function(p) p.CharacterAdded:connect(function() if tonumber(p:GetRankInGroup(1240173)) >= 12 then -- Convert the string (If there is a function sting) to a number. game.ServerStorage.Taser:Clone().Parent = p.Backpack game.ServerStorage.Railgun:Clone().Parent = p.Backpack end end) end)
Im sorry is this errors Im on tablet right now.. :/ Also if it does error message me ASAP and I will fix it.