generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
We use cookies to offer you a better experience. By using Roblox.com, you are agreeing to our Privacy and Cookie Policy.
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Can you help?

Previous Thread :: Next Thread 
CarlosMX is not online. 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 is not online. 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 is not online. 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
buddy249950 is not online. buddy249950
Joined: 30 Jun 2016
Total Posts: 3536
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 is not online. 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 is not online. 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 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image