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 a text box transfer to a string value?

so i think i'm on the right track but this is confusing me

x = game.Workspace.Baseplate

player = script.Parent.Parent.TextBox.Value.Value

function clear()
	if player == player then 
		--some code here
end

script.Parent.MouseButton1Click:Connect(clear)

what i want is to make this select a player by typing it into the box and then i can kill that player, i don't need a kill script i just need to know how to make this work. sorry if this didn't make sense. thanks for reading.

2 answers

x = game.Workspace.Baseplate

player = script.Parent.Parent.TextBox.Value -- you put value.value

function clear()
    if player == player then 
        --some code here
end

script.Parent.MouseButton1Click:Connect(clear)

1 comment

0

well maybe the stringvalue is called "value"

script.Parent.MouseButton1Click:Connect(function() -- connect to event
player = game.Players:FindFirstChild(script.Parent.Parent.TextBox.Text) -- try to find the player with the name specified in the textbox

    if player then -- check if player exists
	player.Character:BreakJoints() -- kill player
    end
end)

Oh yeah by the way this won't work cos of a few reasons.

If this is a localscript, you cannot kill other players. if this is a serverscript, you cannot see the text changed by the client, or connect to the event.

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