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
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: CurrentCamera

Previous Thread :: Next Thread 
ayub32 is not online. ayub32
Joined: 27 Dec 2009
Total Posts: 485
21 May 2014 07:46 PM
The output is returning an error on line 21 and I can't seem to find it. The ouput returned
Players.Player3.PlayerGui.Spectate.SpectateGUI.LocalScript:21: attempt to index field '?' (a nil value)
Here is the script


players = {}
cam = game.workspace.CurrentCamera
num = 0
players = game.Players:getPlayers()
function spectate(human)
plr = game.Players:getPlayerFromCharacter(human.Parent)
if human.className == "Humanoid" and plr.Playing.Value == true then
cam.CameraSubject = human
end
end
script.Parent.Forward.MouseButton1Click:connect(function()
num = num + 1
local humanoid = players[num].Character.Humanoid
-- script.Parent.Current.Value = humanoid
spectate(humanoid)
if num == #players then
num = 1
end
end)
script.Parent.Backward.MouseButton1Click:connect(function()
num = num-1
local humanoid = players[num].Character.Humanoid
-- script.Parent.Current.Value = humanoid
spectate(humanoid)
if num == 0 then
num = #players
end
end)








players = game.Players:getPlayers()
Report Abuse
ayub32 is not online. ayub32
Joined: 27 Dec 2009
Total Posts: 485
21 May 2014 07:53 PM
Bump
Report Abuse
ayub32 is not online. ayub32
Joined: 27 Dec 2009
Total Posts: 485
22 May 2014 05:31 AM
Anyone?
Report Abuse
bradz234 is not online. bradz234
Joined: 02 Aug 2009
Total Posts: 31
22 May 2014 05:53 AM
Its supposed to be .MouseButton1Down, not .MouseButton1Click.
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