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