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

Works in studio but not in-game.. Help?

Asked by
uZelt 15
8 years ago

The scripts kicks players when f2 is pressed

function onKeyPress(inputObject, gameProcessedEvent)
    if inputObject.KeyCode == Enum.KeyCode.F2 then
    for z, x in pairs(game.Players:GetPlayers()) do 
    x:Kick()
end
end
end
 game:GetService("UserInputService").InputBegan:connect(onKeyPress)
0
Is this a LocalScript? TickerOfTime 70 — 8y
0
No uZelt 15 — 8y

Answer this question