CarlosMX
|
  |
| Joined: 30 Apr 2011 |
| Total Posts: 791 |
|
|
| 05 Feb 2013 03:26 PM |
I've got this spectate gui, and I'm trying to make it spectate a car if it's name is typed in. Thing is its not working, can anyone see any faults?
script.Parent.MouseButton1Click:connect(function () local check = game.Workspace.Startinggrid.Cars(script.Parent.Parent.TargetName.Text) if check ~= nil then game.Workspace.Camera.CameraSubject = game.Workspace.Startinggrid.Cars[script.Parent.Parent.TargetName.Text].Torso end end) |
|
|
| Report Abuse |
|
|
TacoBowls
|
  |
| Joined: 02 Mar 2009 |
| Total Posts: 112 |
|
|
| 05 Feb 2013 03:47 PM |
> "can anyone see any faults?".
My output can: MouseButton1Click is not a valid member of Workspace Line 1 stack end
:) |
|
|
| Report Abuse |
|
|
Azarth
|
  |
| Joined: 17 Aug 2012 |
| Total Posts: 2760 |
|
|
| 05 Feb 2013 03:49 PM |
@taco it's in a gui, not in workspace..
And it's "CurrentCamera" not Camera. |
|
|
| Report Abuse |
|
|
|
| 05 Feb 2013 03:49 PM |
| @Taco Did you even read his code? It has a camera which must mean it's a local script in the player, which would make it NOT in workspace. |
|
|
| Report Abuse |
|
|
TacoBowls
|
  |
| Joined: 02 Mar 2009 |
| Total Posts: 112 |
|
|
| 05 Feb 2013 03:53 PM |
oi, then Azarth is right.
Wasn't paying attention to that, hehe. |
|
|
| Report Abuse |
|
|
CarlosMX
|
  |
| Joined: 30 Apr 2011 |
| Total Posts: 791 |
|
|
| 05 Feb 2013 06:55 PM |
I changed it to this: script.Parent.MouseButton1Click:connect(function () local check = game.Workspace.Startinggrid.Cars(script.Parent.Parent.TargetName.Text) if check ~= nil then game.Workspace.CurrentCamera.CameraSubject = game.Workspace.Startinggrid.Cars[script.Parent.Parent.TargetName.Text].Torso end end)
And it still doesn't work. This is the line that was changed: game.Workspace.CurrentCamera.CameraSubject
Originally was:
game.Workspace.Camera.CameraSubject = |
|
|
| Report Abuse |
|
|
CarlosMX
|
  |
| Joined: 30 Apr 2011 |
| Total Posts: 791 |
|
|
| 05 Feb 2013 07:01 PM |
Output message: 13:58:46.875 - Players.Player1.PlayerGui.SpectateGui.MainFrame.Output.Spec:2: attempt to call field 'Cars' (a userdata value) |
|
|
| Report Abuse |
|
|