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
7 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?

01local this = script.Parent
02local killtext = script.Parent.Parent.Killtext.Text
03local players = game.Players
04 
05 
06this.Activated:connect (function()
07    local killtext = script.Parent.Parent.Killtext.Text
08 
09    local player = workspace:WaitForChild(killtext)
10    print ("kill " .. player.Name)
11if player then
12    player.Head:Destroy()
13end
14 
15 
16end)
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 — 7y
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 — 7y

1 answer

Log in to vote
0
Answered by
chasedig1 115
7 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