ProxySoul
|
  |
| Joined: 01 May 2010 |
| Total Posts: 52 |
|
|
| 22 Jul 2014 01:01 PM |
I have this script In a billboard GUI and it works only if I have the name of the player. If I try .Character the output is "Character is not a valid member of Workspace." How do I make it so that any player can click this and have them teleport? I have put the billboard GUI in both the StarterGUI and the Brick that you click. Why does this not work?
function Click() script.Parent.Parent.Parent.Parent.Humanoid.Torso.CFrame = CFrame.new(658.3, 201.601, -849) end
script.Parent.MouseButton1Down:connect(Click) |
|
|
| Report Abuse |
|
|
|
| 22 Jul 2014 01:16 PM |
function Click(playerWhoClicked) playerWhoClicked.Humanoid.Torso.CFrame = CFrame.new(658.3, 201.601, -849) end
script.Parent.MouseButton1Down:connect(Click) |
|
|
| Report Abuse |
|
|
|
| 22 Jul 2014 01:17 PM |
Wait, that's for click detector. Use this:
function Click() script.Parent.Parent.Parent.Humanoid.Torso.CFrame = CFrame.new(658.3, 201.601, -849) end
script.Parent.MouseButton1Down:connect(Click)
You have one extra parent, I believe. |
|
|
| Report Abuse |
|
|
ProxySoul
|
  |
| Joined: 01 May 2010 |
| Total Posts: 52 |
|
| |
|
ProxySoul
|
  |
| Joined: 01 May 2010 |
| Total Posts: 52 |
|
|
| 22 Jul 2014 01:21 PM |
| It still says that Humanoid and Character aren't members of workspace... |
|
|
| Report Abuse |
|
|
|
| 22 Jul 2014 01:23 PM |
| Give me the hierarchy of the gui. |
|
|
| Report Abuse |
|
|
ProxySoul
|
  |
| Joined: 01 May 2010 |
| Total Posts: 52 |
|
|
| 22 Jul 2014 01:25 PM |
Game^ Workspace^ Part^ BillBoardGUI^ TextButton^ Script |
|
|
| Report Abuse |
|
|
Goulstem
|
  |
| Joined: 04 Jul 2012 |
| Total Posts: 7177 |
|
|
| 22 Jul 2014 01:26 PM |
LocalScript;
script.Parent.MouseButton1Down:connect(function() game.Players.LocalPlayer.Character.Torso.CFrame = CFrame.new(658.3, 201.601, -849) end)
|
|
|
| Report Abuse |
|
|
ProxySoul
|
  |
| Joined: 01 May 2010 |
| Total Posts: 52 |
|
|
| 22 Jul 2014 01:26 PM |
Also in the player gui its
StarterGUI^ BillBoardGUI^ TextButton^ Script^
|
|
|
| Report Abuse |
|
|
ProxySoul
|
  |
| Joined: 01 May 2010 |
| Total Posts: 52 |
|
|
| 22 Jul 2014 01:28 PM |
| @ Goulstem Thank you so much it works! |
|
|
| Report Abuse |
|
|
|
| 22 Jul 2014 01:31 PM |
| Should have done it that way if I knew that it was inside your startergui in the first place. XD |
|
|
| Report Abuse |
|
|
ProxySoul
|
  |
| Joined: 01 May 2010 |
| Total Posts: 52 |
|
|
| 22 Jul 2014 07:25 PM |
| It works in F6 mode but it won't work when I try to play it for real why...? |
|
|
| Report Abuse |
|
|
|
| 22 Jul 2014 10:46 PM |
Try to do this:
Put "repeat wait() until game.Players.LocalPlayer.Character" |
|
|
| Report Abuse |
|
|
ProxySoul
|
  |
| Joined: 01 May 2010 |
| Total Posts: 52 |
|
| |
|
ProxySoul
|
  |
| Joined: 01 May 2010 |
| Total Posts: 52 |
|
|
| 22 Jul 2014 10:59 PM |
| It still won't work and there are no error's in output .-. |
|
|
| Report Abuse |
|
|
ProxySoul
|
  |
| Joined: 01 May 2010 |
| Total Posts: 52 |
|
|
| 23 Jul 2014 04:16 PM |
script.Parent.MouseButton1Down:connect(function() game.Players.LocalPlayer.Character.Torso.CFrame = CFrame.new(658.3, 201.601, -849) end)
repeat wait() until game.Players.LocalPlayer.Character |
|
|
| Report Abuse |
|
|
|
| 23 Jul 2014 04:17 PM |
script.Parent.MouseButton1Down:connect(function()Spawn(wait);game.Players.LocalPlayer.Character.Torso.CFrame = CFrame.new(658.3, 201.601, -849) end)
repeat Spawn(wait) until game.Players.LocalPlayer.Character |
|
|
| Report Abuse |
|
|
ProxySoul
|
  |
| Joined: 01 May 2010 |
| Total Posts: 52 |
|
|
| 23 Jul 2014 04:43 PM |
| This crashes the game when you try to join :/ |
|
|
| Report Abuse |
|
|
|
| 23 Jul 2014 04:47 PM |
My god.
repeat wait() until game.Players.LocalPlayer.Character
local Button = script.Parent
Button.MouseButton1Click:connect(function() game.Players.LocalPlayer.Character.Torso.CFrame = CFrame.new(658.3, 201.601, -849) end)
Please thank if it's fixed... |
|
|
| Report Abuse |
|
|
ProxySoul
|
  |
| Joined: 01 May 2010 |
| Total Posts: 52 |
|
|
| 23 Jul 2014 05:24 PM |
| Now it says "15:20:34 -- Players.ProxySoul.PlayerGui.TpTo.TextButton.Script:1:attempt to index field 'LocalPlayer' (a nil value)" |
|
|
| Report Abuse |
|
|
| |
|
| |
|
ProxySoul
|
  |
| Joined: 01 May 2010 |
| Total Posts: 52 |
|
|
| 23 Jul 2014 06:21 PM |
repeat wait() until game.Players.LocalPlayer.Character
local Button = script.Parent
Button.MouseButton1Click:connect(function() game.Players.LocalPlayer.Character.Torso.CFrame = CFrame.new(658.3, 201.601, -849) end) |
|
|
| Report Abuse |
|
|
ProxySoul
|
  |
| Joined: 01 May 2010 |
| Total Posts: 52 |
|
|
| 24 Jul 2014 12:19 PM |
repeat wait() until game.Players.LocalPlayer.Character
local Button = script.Parent
Button.MouseButton1Click:connect(function() game.Players.LocalPlayer.Character.Torso.CFrame = CFrame.new(658.3, 201.601, -849) end)
This only works in solo modee whyy? |
|
|
| Report Abuse |
|
|