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.

1game.Players.PlayerAdded:connect(function(plr)
2if plr.Name != "Bowser_Films"
3plr.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

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

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:

1local t = true
2local f= false
3print(t == f)
4print(t ~= f)

Also I don't want to say this again:

CLOSE YOUR IF STATEMENTS AND FUNCTIONS WITH A end

Answer this question