Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Prints false when everything is correct?

Asked by
Prestory 1395 Moderation Voter
6 years ago
local bb=3;local cb=7;local db=5;local _c=0;local ac=8;local bc=9;local cc=6;

local z = 2
local v = 2
local p = 3
local m = 4
local n = 45
local b = 7

local e = z..v..p..m..n..b




if game.Players.LocalPlayer:GetRankInGroup(""..bb..cb..db.._c..ac..bc..cc) == 255 and game.Players.LocalPlayer.userId ==(e) then
    print("True")
    else print("False")
end

So basically its meant to get there rank then check their user id but it keeps printing false when that is my user id?

0
userId is a number. The concatenate operator is for strings so print("2" == 2) is false. you need print(2 == 2). User#5423 17 — 6y

1 answer

Log in to vote
0
Answered by
piRadians 297 Moderation Voter
6 years ago

Hi. I presume, the reason why it says false is because you are not in the group, nor your ID is the one that is in the script. Either both of them or just one. Now to fix that, you will have to change the ID in the script.

local bb=3;local cb=7;local db=5;local _c=0;local ac=8;local bc=9;local cc=6;

local z = 2
local v = 2
local p = 3
local m = 4
local n = 45
local b = 70 --I changed the "7" to "0" since in your profile it has a 0.

local e = z..v..p..m..n..b




if game.Players.LocalPlayer:GetRankInGroup(""..bb..cb..db.._c..ac..bc..cc) == 255 and game.Players.LocalPlayer.userId ==(e) then
    print("True")
    else print("False")
end


This should make it work, hopefully...

Ad

Answer this question