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 » Scripters
Home Search
 

Re: Adding cframes...

Previous Thread :: Next Thread 
Narutozo is not online. Narutozo
Joined: 28 Jul 2013
Total Posts: 1314
04 Jul 2015 06:54 AM
i want to ADD CFrame not apply it
Player = game.Players.LocalPlayer
Mouse = Player:GetMouse()
pathoff = false
pathing = false

Mouse.KeyDown:connect(function(key)Mouse.KeyDown:connect(function(key)
Key = key:lower()
if key == "c" then
P = Instance.new("Part")
P.Parent = workspace
P.Anchored = true
P.Transparency = 0
P.FormFactor = 3
P.Size = Vector3.new(9,0.00001,9)

while Game:GetService("RunService").Heartbeat:wait() do
P.CFrame = Player.Character.Torso.CFrame * CFrame.new(0,-5,0)
P.TopSurface = "Smooth"
P.BottomSurface = "Smooth"
P.BrickColor = BrickColor.new("Really black")
P.Material = "SmoothPlastic"
wait(0.0000001)

spawn(function()
for i = 1,2 do
wait(0.0001)
P.CFrame = P.CFrame * CFrame.Angles(0,math.rad(20),0) -- this applys cframe.. but it does not add cframe.
wait(0.5)
end
end)
end
end
end)
end)

please post how to fix it with the fixed version below
Report Abuse
Narutozo is not online. Narutozo
Joined: 28 Jul 2013
Total Posts: 1314
04 Jul 2015 06:59 AM
b1
Report Abuse
Narutozo is not online. Narutozo
Joined: 28 Jul 2013
Total Posts: 1314
04 Jul 2015 07:07 AM
b2
Report Abuse
rayk999 is not online. rayk999
Joined: 18 Feb 2011
Total Posts: 4705
04 Jul 2015 07:11 AM
I..don't..understand
Report Abuse
Narutozo is not online. Narutozo
Joined: 28 Jul 2013
Total Posts: 1314
04 Jul 2015 07:12 AM
like i want it to add 20 degrees everytime. it sets it to 20 degrees not adding it to 20 degrees
Report Abuse
rayk999 is not online. rayk999
Joined: 18 Feb 2011
Total Posts: 4705
04 Jul 2015 07:19 AM
Ah, I see your problem.

Since you spawn()ed that part that changes the angle, the while loop will loop through once more. And since you added that tiny wait() in the spawn()ed function, that gives it time to set P.CFrame = Player.Character.Torso.CFrame * CFrame.new(0,-5,0).

And then the for loop inside the spawn()ed function will run again, only to be beaten by the while loop that'll reset P's CFrame.
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
04 Jul 2015 07:35 AM
"wait(0.0000001)"
You can only wait for 0.03 seconds.
wait() does the same thing.
Report Abuse
Alyte is not online. Alyte
Joined: 24 Oct 2011
Total Posts: 10090
04 Jul 2015 07:41 AM
FALSE

you can wait 5 secs too
Report Abuse
rayk999 is not online. rayk999
Joined: 18 Feb 2011
Total Posts: 4705
04 Jul 2015 07:53 AM
lol
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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