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

Script wont work? My script is where it does not allow anybody but me to go inside game and play/

Asked by 6 years ago
Edited 6 years ago

My script is where it does not allow anybody but, me to go inside game. But script wont work, please fix.

game.Players.PlayerAdded:connect(function(plr)
if plr.Name != "Bowser_Films"
plr.kick("Your can not enter inside.")

2 answers

Log in to vote
0
Answered by 6 years ago

Put this in a normal script, not a Local Script

game.Players.PlayerAdded:Connect(function(plr)
    if plr.Name ~= "Bowser_Films" then
        plr:Kick("You're banned")
    end
end)

The problem was that you did " != ", in lua to do not equal to, you must do " ~= ", also you forgot 2 ends, one for the function and one for the if statement .

Ad
Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

the lua symbol for not equals is ~= so an example of this is:

local t = true
local f= false
print(t == f)
print(t ~= f)

Also I don't want to say this again:

CLOSE YOUR IF STATEMENTS AND FUNCTIONS WITH A end

Answer this question