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: Any Ideas?

Previous Thread :: Next Thread 
iSwordFights is not online. iSwordFights
Joined: 07 Nov 2010
Total Posts: 358
12 Jan 2014 08:57 AM
So, I have this script.

function rotate(x,y,z)
angle = angle + x
print(angle)
turret.Seat.CFrame = turret.Seat.CFrame * CFrame.fromEulerAnglesXYZ(math.rad(x),math.rad(y),math.rad(z))
end

while wait() do
if fdown == true then
rotate(0,1,0)
end
if gdown == true then
rotate(-1,0,0)
end
if hdown == true then
rotate(0,-1,0)
end
if tdown == true then
rotate(1,0,0)
end
end

But I want to put a limit on the amount you can rotate.
Report Abuse
iSwordFights is not online. iSwordFights
Joined: 07 Nov 2010
Total Posts: 358
12 Jan 2014 09:00 AM
bUmPiNg
Report Abuse
iSwordFights is not online. iSwordFights
Joined: 07 Nov 2010
Total Posts: 358
12 Jan 2014 09:25 AM
Bump
Report Abuse
iSwordFights is not online. iSwordFights
Joined: 07 Nov 2010
Total Posts: 358
12 Jan 2014 09:36 AM
_Bump
Report Abuse
Nyxis is not online. Nyxis
Joined: 15 Nov 2012
Total Posts: 3374
12 Jan 2014 09:38 AM
_G.Bump = nil
Report Abuse
VoidShredder is not online. VoidShredder
Joined: 06 Jan 2014
Total Posts: 1467
12 Jan 2014 09:39 AM
Check rotation property
Report Abuse
iSwordFights is not online. iSwordFights
Joined: 07 Nov 2010
Total Posts: 358
12 Jan 2014 09:43 AM
So, I added in a check rotation, like so:

function rotate(x,y,z)
if seat.Rotation.X < 70 then
turret.Seat.CFrame = turret.Seat.CFrame * CFrame.fromEulerAnglesXYZ(math.rad(x),math.rad(y),math.rad(z))
end
end

But it breaks. Help?
Report Abuse
iSwordFights is not online. iSwordFights
Joined: 07 Nov 2010
Total Posts: 358
12 Jan 2014 09:48 AM
B__p
Report Abuse
jmasterj10 is not online. jmasterj10
Joined: 19 Sep 2010
Total Posts: 735
12 Jan 2014 10:01 AM
Your not calling the function ._.
Report Abuse
iSwordFights is not online. iSwordFights
Joined: 07 Nov 2010
Total Posts: 358
12 Jan 2014 10:06 AM
No, I did in the rest of the script. The script is over 500 lines, and I didn't want to post it all here. Can someone please just help me limit the x axis?
Report Abuse
iSwordFights is not online. iSwordFights
Joined: 07 Nov 2010
Total Posts: 358
12 Jan 2014 10:10 AM
What happens is whenever it hits the limit, it adds to the rotation, therefor breaking it. How do I fix this?
Report Abuse
iSwordFights is not online. iSwordFights
Joined: 07 Nov 2010
Total Posts: 358
12 Jan 2014 10:16 AM
_bUmP
Report Abuse
iSwordFights is not online. iSwordFights
Joined: 07 Nov 2010
Total Posts: 358
12 Jan 2014 10:29 AM
b.u.m.p
Report Abuse
iSwordFights is not online. iSwordFights
Joined: 07 Nov 2010
Total Posts: 358
12 Jan 2014 10:35 AM
78 views and no help. Dx
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