|
| 27 Oct 2013 03:32 PM |
Im trying to make a GUI that teleports you to a brick and remove the GUI on click. It is not working here it is:
function Click() Workspace.Player.Humanoid:MoveTo(Workspace.SpawnLocation1.Position, Workspace.SpawnLocation1)--- script.Parent.Parent.Visible = false end
script.Parent.MouseButton1Down:connect(Click)
Please explain why this is not working and give the answer.
|
|
|
| Report Abuse |
|
|
|
| 27 Oct 2013 03:34 PM |
A little bit more information would be nice, for example what part of it isn't working - is the teleport part working but not the remove GUI part?
.: LD :. |
|
|
| Report Abuse |
|
|
|
| 27 Oct 2013 03:38 PM |
| It Is The Teleport which is not working |
|
|
| Report Abuse |
|
|
|
| 27 Oct 2013 03:39 PM |
| Basicly nothing happens... |
|
|
| Report Abuse |
|
|
|
| 27 Oct 2013 04:04 PM |
| Please Help I NEED the answer! |
|
|
| Report Abuse |
|
|
|
| 27 Oct 2013 04:11 PM |
Workspace.Player <--Where is this defined?
|
|
|
| Report Abuse |
|
|
|
| 27 Oct 2013 04:13 PM |
Aye internet is right
function Click() Workspace.Player.Humanoid:MoveTo(Workspace.SpawnLocation1.Position, Workspace.SpawnLocation1)--- script.Parent.Parent.Visible = false end
|
|
|
| Report Abuse |
|
|
|
| 27 Oct 2013 04:14 PM |
oops sorry don't use that
function Click(Player) Workspace.Player.Humanoid:MoveTo(Workspace.SpawnLocation1.Position, Workspace.SpawnLocation1)--- script.Parent.Parent.Visible = false end
|
|
|
| Report Abuse |
|
|
|
| 27 Oct 2013 04:19 PM |
You guys realize Humanoid:MoveTo() makes the humanoid walk to the position?
Use CFrame to teleport:
Character.Torso.CFrame = CFrame.new(SpawnLocation.Position) |
|
|
| Report Abuse |
|
|
|
| 27 Oct 2013 04:25 PM |
That did not work either. Am i putting it in wrong?
function Click(Player) Workspace.Player.Torso.CFrame = CFrame.new(SpawnLocation1.Position)--- script.Parent.Parent.Visible = false end
script.Parent.MouseButton1Down:connect(Player)
Please tell me if i put this in right. |
|
|
| Report Abuse |
|
|
|
| 27 Oct 2013 04:27 PM |
change
Workspace.Player.Torso.CFrame = CFrame.new(SpawnLocation1.Position)
to
game.Players[Player].Character.Torso.CFrame = CFrame.new(SpawnLocation1.Position) |
|
|
| Report Abuse |
|
|
|
| 27 Oct 2013 04:36 PM |
Did not work either!
WHATS WRONG WITH IT!
XD |
|
|
| Report Abuse |
|
|
|
| 27 Oct 2013 04:39 PM |
Here it is now:
function Click(Player) game.Players[Player].Character.Torso.CFrame = CFrame.new(SpawnLocation1.Position)--- script.Parent.Parent.Visible = false end
script.Parent.MouseButton1Down:connect(Player) |
|
|
| Report Abuse |
|
|
|
| 27 Oct 2013 04:43 PM |
| Does anyone have an answer? |
|
|
| Report Abuse |
|
|
|
| 27 Oct 2013 04:51 PM |
Ok i am seriously desperate for the script that teleports only the one who clicks.
|
|
|
| Report Abuse |
|
|
|
| 27 Oct 2013 04:55 PM |
| The Output always replies with: Disconnected event because of exception |
|
|
| Report Abuse |
|
|
| |
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 27 Oct 2013 05:03 PM |
function Click() Game.Players.LocalPlayer.Character.Torso.CFrame = CFrame.new(SpawnLocation1.Position)--- script.Parent.Parent.Visible = false end
script.Parent.MouseButton1Down:connect(Player) |
|
|
| Report Abuse |
|
|
|
| 27 Oct 2013 05:09 PM |
That dident work...
Do i have to place that into a local script? |
|
|
| Report Abuse |
|
|
| |
|
Z4ckZ4k
|
  |
| Joined: 07 Jul 2013 |
| Total Posts: 160 |
|
|
| 27 Oct 2013 05:18 PM |
function Click() Workspace.Player1:MoveTo(Workspace.SpawnLocation1.Position)--- script.Parent.Parent.Visible = false end
script.Parent.MouseButton1Down:connect(Click) |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
| |
|
|
| 27 Oct 2013 05:25 PM |
| If you put command and output, press play, and it will tell you your answer. |
|
|
| Report Abuse |
|
|
|
| 27 Oct 2013 05:32 PM |
It said this:
function Click() Game.Players.LocalPlayer.Character.Torso.C:6: attempt to index global 'script' (a nil value) 17:30:56.029 - Script 'function Click() Game.Players.LocalPlayer.Character.Torso.C', Line 6 17:30:56.030 - stack end
Whats the nil value? |
|
|
| Report Abuse |
|
|
|
| 27 Oct 2013 05:35 PM |
"nil value" means that it doesn't exist. Anyways, make sure it's in a LocalScript, and replace your Click function with this:
function Click() game.Players.LocalPlayer.Player:MoveTo(game.Workspace.SpawnLocation1.Position) game.Players.LocalPlayer.PlayerGui.SCREENGUI_NAME.GUIOBJECT_NAME.Visible = false -- Swag out SCREENGUI_NAME and GUIOBJECT_NAME end
Wiki Profile: http://wiki.roblox.com/index.php/User:Nelson |
|
|
| Report Abuse |
|
|