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

The Killer Gui wont Kill anyone when someone Clicks on the button can someone help me???

Asked by 6 years ago

so I wanted to make a gui that can kill people by adding their username and clicking on "Kill Em!" Which removes their head which then causes them to die but for some reason, it won't work I dont know what to do and how to fix this, can someone help me please!

local plr = game.Players.
local txt = script.Parent.Parent.Player.Text

function onClick()
    Player = plr + txt + ".Character"
    Player.Head:Destroy()
end

script.Parent.Parent.Submit.MouseButton1Click:Connect(onClick)
0
Since GUI is local and is different on every single player's screen, you can't access the server from something local. You'll need to learn how FilteringEnabled works. Pojoto 329 — 6y

2 answers

Log in to vote
1
Answered by
Qariter 110
6 years ago

Are you trying to run it from a localscript? if so, then you have to run it with a remote event, otherwise the person wont be dead on their screen, but for yours yes.

Ad
Log in to vote
0
Answered by
CyDave 42
6 years ago

Use Remote events as the change will only happen on the players screen and not the server thus not killing him

Answer this question