Why does my kill all script when ''F'' is pressed work in roblox studio but not in online?
Hi, i made a script that can kill every player in the server if you press ''F''' on your keyboard and it works fine, however, it doesn't when i test this in online roblox server but it does work in roblox studio. I think it's because the script i made is located inside workspace or because it's just a normal script? I'm not sure. Can anyone help me? Oh btw, how do i make this script that only the owner or my username ''ali7682'' can kill everyone by just pressing ''F''? Thanks! (Here is the script if needed).
01 | local uis = game:GetService( "UserInputService" ) |
02 | uis.InputBegan:connect( function (inst) |
03 | if inst.KeyCode = = Enum.KeyCode.F then |
04 | for i, player in ipairs (game.Players:GetPlayers()) do |
05 | if player.Character then |
06 | local hum = player.Character:FindFirstChild( 'Humanoid' ) |