Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Why does it output "Attempt to compare number with string"?

Here is the bit that it gives the out put on.


Tool.Equipped:connect(function(mouse)
    if player:IsInGroup(2608221)then
	if player:GetRoleInGroup(2608221) > 1 then   
        AnimTrack2:Play()
    end

2 answers

Because "GetRoleInGroup" returns the string value of the role. And you're comparing it to a numerical value of 1 using the greater than symbol.

This discussion is preserved as it was. New answers, comments, and votes are closed.