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

Why isn't this if/then statment working? Also it dosen't give any errors? [Solved]

Asked by 3 years ago
Edited by JesseSong 3 years ago

This simple if/then statement isn't working. It also doesn't print any errors. I can't figure out what's wrong with it

local Event = game.ReplicatedStorage.Tools.GiveGun
local Gun = game.ServerStorage.Tools.Gun

Event.OnServerEvent:Connect(function(Player)
    if Player.Stats.Gun.Value == false then
        print("Gun isn't unlocked.")
    end
end)
0
Please include all operating code, like the local script that's calling the event. deeskaalstickman649 475 — 3y
0
If you solved a question then put [Solved] or [Answered] in the begining or end of the question JesseSong 3916 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago

In Lua, if a value is not false or nil, it’s considered “true” when used in a conditional statement. https://developer.roblox.com/en-us/articles/Boolean

Ad

Answer this question