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
 

Canoe Script

Previous Thread :: Next Thread 
DuskC is not online. DuskC
Joined: 26 Oct 2009
Total Posts: 37
22 Jun 2013 10:04 PM
So I've built this Canoe, and I tried the traditional way of floating on Roblox, but it just kept sinking. so I added this script for a seat and it sort of works. The only problem is that the Canoe always sinks a ways below where I place it on the Water the floats. Help? If you would like to try it out, it's in my free models.

Script:
script.Parent.MaxSpeed = 30
maxspeed =script.Parent.MaxSpeed
script.Parent.BodyPosition.position = script.Parent.Position

script.Parent.BodyGyro.cframe = script.Parent.CFrame
value1 = 0
while true do
wait()
if script.Parent.Throttle== 1 then
if value1 < maxspeed then value1 = value1+1 end
script.Parent.Parent.Driving.Value = true
script.Parent.BodyVelocity.velocity = script.Parent.CFrame.lookVector*value1
script.Parent.Parent.Left.Value = false
script.Parent.Parent.Right.Value = false
end
if script.Parent.Throttle == 0 then
value1 = 0
script.Parent.Parent.Driving.Value = false
script.Parent.BodyVelocity.velocity = script.Parent.CFrame.lookVector*value1
script.Parent.Parent.Left.Value = false
script.Parent.Parent.Right.Value = false
end
if script.Parent.Throttle== -1 then
if value1<31 then value1 = value1+1 end
script.Parent.Parent.Driving.Value = true
script.Parent.BodyVelocity.velocity = script.Parent.CFrame.lookVector*-value1
script.Parent.Parent.Left.Value = false
script.Parent.Parent.Right.Value = false
end
if script.Parent.Steer == 1 then
script.Parent.BodyGyro.cframe = script.Parent.BodyGyro.cframe * CFrame.fromEulerAnglesXYZ(0,-.01,0)
script.Parent.Parent.Driving.Value = true
script.Parent.Parent.Right.Value = true
script.Parent.Parent.Left.Value = false
end
if script.Parent.Steer == -1 then
script.Parent.BodyGyro.cframe = script.Parent.BodyGyro.cframe * CFrame.fromEulerAnglesXYZ(0,.01,0)
script.Parent.Parent.Driving.Value = true
script.Parent.Parent.Left.Value = true
script.Parent.Parent.Right.Value = false
end
end
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