I want the name in the textbox to be killed in the game. it works in studio but not in the real game. How do i fix?
01 | local this = script.Parent |
02 | local killtext = script.Parent.Parent.Killtext.Text |
03 | local players = game.Players |
04 |
05 |
06 | this.Activated:connect ( function () |
07 | local killtext = script.Parent.Parent.Killtext.Text |
08 |
09 | local player = workspace:WaitForChild(killtext) |
10 | print ( "kill " .. player.Name) |
11 | if player then |
12 | player.Head:Destroy() |
13 | end |
14 |
15 |
16 | end ) |
If you have FilteringEnabled on, you'll need to utilize RemoteEvents and or RemoteFunctions or the GUI won't affect the real game.