|
| 20 Oct 2015 03:10 PM |
I'm trying to get the text that the player has written inside the TextBox, and then have the name (of which the player has typed into the TextBox) become the variable "player". Once the "Kill" button is clicked, the targeted player would die. Should I use a string instead, or is this just wrong?
Script:
function onClicked() local find1 = script.Parent.Parent:FindFirstChild("Target_Player") local find2 = find1.Text local player = game.Players:FindFirstChild("find2") player.Character:BreakJoints() end script.Parent.MouseButton1Click:connect(onClicked) |
|
|
| Report Abuse |
|
|
| |
|
|
| 20 Oct 2015 03:26 PM |
| Take out the quotes surrounding 'find2' since it's the variable pointing to the TextBox's text. You might also want to check if the player exists as well before attempting to get the character. |
|
|
| Report Abuse |
|
|
|
| 20 Oct 2015 03:37 PM |
Thanks. I can't believe I missed that. x.x Now it works fine. :P
~MightyDantheman |
|
|
| Report Abuse |
|
|