Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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)

2 comments

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.

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.

1 answer

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

This discussion is preserved as it was. New answers, comments, and votes are closed.