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

whats wrong with my script?

text = game.StarterGui.ScreenGui.Frame.TextBox.Text

Spawn.MouseButton1Down:connect(function(spawn)

local ID = "item"..game.ScreenGui.ScreenGui.Frame.TextBox.Text

print(ID)

end)

.. It doesnt work.. It doesnt print anything

1 comment

0

because you are printing an object. and because you have a wrong access point to the value. A side note, there is something called game.players.LocalPlayers; its very handy for stuff like this.

1 answer

✓ Accepted answer
text = game.Players.LocalPlayer.PlayerGui.Frame.TextBox.Text
Spawn = ???? --you need to define spawn
Spawn.MouseButton1Down:connect(function(spawn)
	local ID = "item"..text
	print(ID)
end)

You forgot to define spawn and also the text would be in the PlayerGUi

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