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

How do i make this script work in my normal game and make it kill the player?

Asked by
Plieax 66
6 years ago

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?

local this = script.Parent
local killtext = script.Parent.Parent.Killtext.Text
local players = game.Players


this.Activated:connect (function()
    local killtext = script.Parent.Parent.Killtext.Text

    local player = workspace:WaitForChild(killtext)
    print ("kill " .. player.Name)
if player then
    player.Head:Destroy()
end


end)
0
You'll need to use Remote Events or Remote Functions in order for this to work. Anything locally (the GUI) won't work in Real Game, since you're going from Client to Server. LukeGabrieI 73 — 6y
0
if you have FilteringEnabled on then this will not work unless you use Remote's. If you don't know what those are go to the ROBLOX wiki article. VeryDarkDev 47 — 6y

1 answer

Log in to vote
0
Answered by
chasedig1 115
6 years ago

If you have FilteringEnabled on, you'll need to utilize RemoteEvents and or RemoteFunctions or the GUI won't affect the real game.

Ad

Answer this question