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: Please help me!

Previous Thread :: Next Thread 
Awesomesniperman1 is not online. Awesomesniperman1
Joined: 26 Sep 2011
Total Posts: 3780
25 Jul 2013 10:17 AM
I've been trying to make it so that it rotates around an object when you first enter or respawn (like at Washington DC).
I've had no luck getting the camera to return to its original settings, so that the play can once again control it, nor have I been able to make it rotate successfully, as CFraming/angles aren't my strong point.
Most of this is from the wiki.
-------------
local target = game.Workspace.special
local camera = game.Workspace.CurrentCamera
camera.CameraSubject = target
camera.CameraType = "Fixed"
local angle = 0

while wait() do
camera.CoordinateFrame = CFrame.new(target.Position) --Start at the position of the part
* CFrame.Angles(0, angle, 0) --Rotate by the angle
* CFrame.new(0, 0, 0) --Move the camera backwards _ units
angle = angle + math.rad(1)
end

function click()
game.Workspace.CurrentCamera.CameraSubject = game.Players.LocalPlayer.Character.Humanoid
game.Workspace.CurrentCamera.CameraType = "Custom"
end

script.Parent.ScreenGui.Play.MouseButton1Down:connect(click)
Report Abuse
Awesomesniperman1 is not online. Awesomesniperman1
Joined: 26 Sep 2011
Total Posts: 3780
25 Jul 2013 10:18 AM
so that the player can once again control it*
sorry for my spelling errors
Report Abuse
evolvedpikachu is not online. evolvedpikachu
Joined: 18 Aug 2010
Total Posts: 10696
25 Jul 2013 10:18 AM
You have to break your loop function.
Report Abuse
ScrewDeath is not online. ScrewDeath
Joined: 03 Jun 2012
Total Posts: 2700
25 Jul 2013 10:27 AM
When I try to make things orbit, I usually use lookVector that gets affected by rotation to its cframe.
Report Abuse
Awesomesniperman1 is not online. Awesomesniperman1
Joined: 26 Sep 2011
Total Posts: 3780
25 Jul 2013 10:29 AM
And how would I break my loop function?
(I only want it to break when someone presses the play button).

~RAT is a clan, now get in my van. ®
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
25 Jul 2013 10:30 AM
break

while true do
break
end
print("HI")
>HI

YAY NO GAME FROZEN!
Report Abuse
Awesomesniperman1 is not online. Awesomesniperman1
Joined: 26 Sep 2011
Total Posts: 3780
25 Jul 2013 10:30 AM
Also, another problem I'm having is that the Camera isn't looking AT the part, it's doing the opposite.
What can I do to make it FACE the part?

~RAT is a clan, now get in my van. ®
Report Abuse
Awesomesniperman1 is not online. Awesomesniperman1
Joined: 26 Sep 2011
Total Posts: 3780
25 Jul 2013 10:31 AM
@cnt
I ONLY want it to break when someone presses a button.

~RAT is a clan, now get in my van. ®
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
25 Jul 2013 10:33 AM
local click = false

Button.MouseButton1Down:connect(function()
click = true
end)

while ture do
if click
break
else
lololol
end
end
Report Abuse
Awesomesniperman1 is not online. Awesomesniperman1
Joined: 26 Sep 2011
Total Posts: 3780
25 Jul 2013 10:43 AM
do i put the main script where lolololol is?

~RAT is a clan, now get in my van. ®
Report Abuse
Awesomesniperman1 is not online. Awesomesniperman1
Joined: 26 Sep 2011
Total Posts: 3780
25 Jul 2013 10:45 AM
my mind isn't working today
extra help needed

~RAT is a clan, now get in my van. ®
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
25 Jul 2013 10:45 AM
yup, don't forget to add a wait
Report Abuse
Awesomesniperman1 is not online. Awesomesniperman1
Joined: 26 Sep 2011
Total Posts: 3780
25 Jul 2013 11:02 AM
After the 'break end', the else gives me an error. It says: 'end' expected (to close 'while' at line 13 near 'else'.

I'm not missing any 'end's, am I?
---------------------------------------------------------
local target = game.Workspace.special
local camera = game.Workspace.CurrentCamera
camera.CameraSubject = target
camera.CameraType = "Fixed"
local angle = 0
local button = script.Parent.ScreenGui.Play
local click = false

button.MouseButton1Down:connect(function()
click = true
end)

while true do
wait(0.1)
if click then
break
end
else
while wait() do
camera.CoordinateFrame = CFrame.new(target.Position) --Start at the position of the part
* CFrame.Angles(0, angle, 0) --Rotate by the angle
* CFrame.new(0, 0, 0) --Move the camera backwards ,,_ units
angle = angle + math.rad(1)
end
end


function click()
game.Workspace.CurrentCamera.CameraSubject = game.Players.LocalPlayer.Character.Humanoid
game.Workspace.CurrentCamera.CameraType = "Custom"
end

script.Parent.ScreenGui.Play.MouseButton1Down:connect(click)
Report Abuse
Awesomesniperman1 is not online. Awesomesniperman1
Joined: 26 Sep 2011
Total Posts: 3780
25 Jul 2013 11:08 AM
mind still not working
even more help needed

~RAT is a clan, now get in my van. ®
Report Abuse
Awesomesniperman1 is not online. Awesomesniperman1
Joined: 26 Sep 2011
Total Posts: 3780
25 Jul 2013 11:11 AM
cntkillme
where are you!?!?!
:(

~RAT is a clan, now get in my van. ®
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
25 Jul 2013 11:12 AM
huh wat?
Report Abuse
Awesomesniperman1 is not online. Awesomesniperman1
Joined: 26 Sep 2011
Total Posts: 3780
25 Jul 2013 11:13 AM
look above
i get an error at 'else'

~RAT is a clan, now get in my van. ®
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
25 Jul 2013 11:13 AM
Tab the script and see if ends are mismatched
Report Abuse
Awesomesniperman1 is not online. Awesomesniperman1
Joined: 26 Sep 2011
Total Posts: 3780
25 Jul 2013 11:18 AM
Nothing is mismatched...

~RAT is a clan, now get in my van. ®
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
25 Jul 2013 11:19 AM
What is the exact output?
Report Abuse
Awesomesniperman1 is not online. Awesomesniperman1
Joined: 26 Sep 2011
Total Posts: 3780
25 Jul 2013 11:19 AM
Whatever this error is, it breaks the entire script.
Is it because I have while true do and then while wait() do?

~RAT is a clan, now get in my van. ®
Report Abuse
Awesomesniperman1 is not online. Awesomesniperman1
Joined: 26 Sep 2011
Total Posts: 3780
25 Jul 2013 11:20 AM
The exact output is this:
12:19:46.965 - Players.Player1.PlayerGui.LocalScript:18: 'end' expected (to close 'while' at line 13) near 'else'

~RAT is a clan, now get in my van. ®
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
25 Jul 2013 11:21 AM
The ends are mismatched
Report Abuse
Awesomesniperman1 is not online. Awesomesniperman1
Joined: 26 Sep 2011
Total Posts: 3780
25 Jul 2013 11:26 AM
I rewrote the entire thing using the auto tab and it still errors.

~RAT is a clan, now get in my van. ®
Report Abuse
Awesomesniperman1 is not online. Awesomesniperman1
Joined: 26 Sep 2011
Total Posts: 3780
25 Jul 2013 11:28 AM
This is the strangest error I've ever seen.
The funny thing is if a put any random crap at the top of the script, the 'else' stops erroring.

~RAT is a clan, now get in my van. ®
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