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: What is wrong with this...

Previous Thread :: Next Thread 
REM25 is online. REM25
Joined: 28 Feb 2010
Total Posts: 3154
22 Nov 2013 06:24 PM
d = false
function onclick()
if d ~= false then return end
d = true
local Cam = game.Workspace.CurrentCamera
local Humanoid = game.Players.Character.Humanoid
Cam.CameraSubject = Humanoid
Cam.CameraType = "Custom"
d = false
end

script.Parent.MouseButton1Down:connect(onclick)
Report Abuse
notsopwnedg is not online. notsopwnedg
Joined: 07 Nov 2010
Total Posts: 4182
22 Nov 2013 06:25 PM
game.Players.LocalPlayer.Character.Humanoid
Report Abuse
Bebee2 is not online. Bebee2
Joined: 17 May 2009
Total Posts: 3985
22 Nov 2013 06:26 PM
-- Use a local script.


d = false
function onclick()
if d ~= false then return end
d = true
local Cam = game.Workspace.CurrentCamera
local Humanoid = game.Players.LocalPlayer.Character.Humanoid --[[ Never defined the holder of the character.]]
Cam.CameraSubject = Humanoid
Cam.CameraType = "Custom"
d = false
end

script.Parent.MouseButton1Down:connect(onclick)
Report Abuse
REM25 is online. REM25
Joined: 28 Feb 2010
Total Posts: 3154
22 Nov 2013 06:26 PM
wait what do you mean holder of character?
Report Abuse
Bebee2 is not online. Bebee2
Joined: 17 May 2009
Total Posts: 3985
22 Nov 2013 06:29 PM
game.Players is a service.


game.Players.Character doesn't exist because the service doesn't have a character.


game.Players:WaitForChild'Bebee2'.Character exists since Bebee2 has a character... given that I actually am inside when the code is running.
Report Abuse
REM25 is online. REM25
Joined: 28 Feb 2010
Total Posts: 3154
22 Nov 2013 06:29 PM
so I just add game.Players:WaitForChild()
Report Abuse
notsopwnedg is not online. notsopwnedg
Joined: 07 Nov 2010
Total Posts: 4182
22 Nov 2013 06:30 PM
Noooooooooooooo...
Report Abuse
REM25 is online. REM25
Joined: 28 Feb 2010
Total Posts: 3154
22 Nov 2013 06:30 PM
d = false
function onclick()
if d ~= false then return end
d = true
local Cam = game.Workspace.CurrentCamera
local player = game.Players:WaitForChild()
Cam.CameraSubject = player.Character.Humanoid
Cam.CameraType = "Custom"
d = false
end

script.Parent.MouseButton1Down:connect(onclick)
Report Abuse
notsopwnedg is not online. notsopwnedg
Joined: 07 Nov 2010
Total Posts: 4182
22 Nov 2013 06:31 PM
Like dis.

d = false
function onclick()
if d then return end
d = true
local Cam = game.Workspace.CurrentCamera
local player = game.Players.LocalPlayer
Cam.CameraSubject = player.Character.Humanoid
Cam.CameraType = "Custom"
d = false
end

script.Parent.MouseButton1Down:connect(onclick)
Report Abuse
Bebee2 is not online. Bebee2
Joined: 17 May 2009
Total Posts: 3985
22 Nov 2013 06:31 PM
Go use the script I gave you.
Report Abuse
REM25 is online. REM25
Joined: 28 Feb 2010
Total Posts: 3154
22 Nov 2013 06:34 PM
it doesn't work and Bebee2 what script?
Report Abuse
pokemaster179 is not online. pokemaster179
Joined: 29 Sep 2013
Total Posts: 96
22 Nov 2013 06:34 PM
http://www.roblox.com/Forum/ShowPost.aspx?PostID=118465032 Please help Me too
Report Abuse
Bebee2 is not online. Bebee2
Joined: 17 May 2009
Total Posts: 3985
22 Nov 2013 06:35 PM
d = false
function onclick()
if script:IsA'LocalScript' then
if d ~= false then return end
d = true
local Cam = game.Workspace.CurrentCamera
local Humanoid = game.Players.LocalPlayer.Character.Humanoid Cam.CameraSubject = Humanoid
Cam.CameraType = "Custom"
d = false
else
print'You/'re not using a LocalScript.'
end
end

script.Parent.MouseButton1Down:connect(onclick)



Report Abuse
REM25 is online. REM25
Joined: 28 Feb 2010
Total Posts: 3154
22 Nov 2013 06:36 PM
Btw there is a red line on the print line...
Report Abuse
REM25 is online. REM25
Joined: 28 Feb 2010
Total Posts: 3154
22 Nov 2013 06:40 PM
doesn't work :/
Report Abuse
Bebee2 is not online. Bebee2
Joined: 17 May 2009
Total Posts: 3985
22 Nov 2013 06:40 PM
d = false
function onclick()
if script:IsA'LocalScript' then
if d ~= false then return end
d = true
local Cam = game.Workspace.CurrentCamera
local Humanoid = game.Players.LocalPlayer.Character.Humanoid Cam.CameraSubject = Humanoid
Cam.CameraType = "Custom"
d = false
else
print'You\'re not using a LocalScript.' -- Oopsies. Wrong slash.
end
end

script.Parent.MouseButton1Down:connect(onclick)

Report Abuse
REM25 is online. REM25
Joined: 28 Feb 2010
Total Posts: 3154
22 Nov 2013 06:42 PM
doesn't work.....
Report Abuse
REM25 is online. REM25
Joined: 28 Feb 2010
Total Posts: 3154
22 Nov 2013 06:44 PM
This never works! DAYUMM!!!!
Report Abuse
CodTranzitZombies is not online. CodTranzitZombies
Joined: 10 Dec 2012
Total Posts: 764
22 Nov 2013 06:45 PM
I can help maybe,
I just hold up let me get my script.
Report Abuse
Bebee2 is not online. Bebee2
Joined: 17 May 2009
Total Posts: 3985
22 Nov 2013 06:46 PM
If the output prints "You're not using a LocalScript."


then you aren't using a local script and the script will fail.




It works perfectly fine for me. Just tested it, actually.
Report Abuse
REM25 is online. REM25
Joined: 28 Feb 2010
Total Posts: 3154
22 Nov 2013 06:46 PM
umm okay?

Anyone help!
Report Abuse
REM25 is online. REM25
Joined: 28 Feb 2010
Total Posts: 3154
22 Nov 2013 06:46 PM
Bebee it didnt print anything for me...
Report Abuse
CodTranzitZombies is not online. CodTranzitZombies
Joined: 10 Dec 2012
Total Posts: 764
22 Nov 2013 06:47 PM
Put this in a local gui!




wait(0.1) -- Wait time before starting the script or the script won't work.
do workspace.CurrentCamera.CameraType = "Custom"
end workspace.CurrentCamera.CameraSubject = script.Parent.Parent.Character.Humanoid --Goes in the character
wait(0.1)
do script.Remove() -- Removes script.
end
Report Abuse
REM25 is online. REM25
Joined: 28 Feb 2010
Total Posts: 3154
22 Nov 2013 06:48 PM
^no...
Report Abuse
REM25 is online. REM25
Joined: 28 Feb 2010
Total Posts: 3154
22 Nov 2013 06:49 PM
weird...now it works wtf...
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