|
| 10 Jan 2015 05:26 PM |
Hi, I have a c-frame spin inserted into a tool that I'm using to make a gear(tool) rotate, but when the tool is equipped it makes your character fly around the map spinning(due to the rotate script), could someone show me what I need to add to this script to make it not spin when it is picked up/equipped? here is the script:
spinning = script.Parent
while true do spinning.CFrame = spinning.CFrame * CFrame.fromEulerAnglesXYZ(0, math.rad(3), 0) wait(0.05) end
|
|
|
| Report Abuse |
|
|
| |
|
BotBit
|
  |
| Joined: 05 Jan 2015 |
| Total Posts: 163 |
|
| |
|
| |
|
BotBit
|
  |
| Joined: 05 Jan 2015 |
| Total Posts: 163 |
|
|
| 10 Jan 2015 05:42 PM |
| ill try to fix it, uno momento. |
|
|
| Report Abuse |
|
|
|
| 10 Jan 2015 05:45 PM |
| thanks, it works as it should, when i insert the script into the handle of the tool it makes it spin, but when I pick up the tool I spin along with it, I need an addition to the script that would disable the spin script when a player picks up the tool, i just dont know how to write even simple code |
|
|
| Report Abuse |
|
|
BotBit
|
  |
| Joined: 05 Jan 2015 |
| Total Posts: 163 |
|
| |
|
| |
|
| |
|
|
| 10 Jan 2015 06:23 PM |
| is it in the tool, or in a part in the tool? |
|
|
| Report Abuse |
|
|
BotBit
|
  |
| Joined: 05 Jan 2015 |
| Total Posts: 163 |
|
| |
|
|
| 10 Jan 2015 07:27 PM |
spinning = script.Parent local pickedup = false
while not pickedup do spinning.CFrame = spinning.CFrame * CFrame.fromEulerAnglesXYZ(0, math.rad(3), 0) wait(0.05) end
script.Parent.Parent.Equipped:connect(function() pickedup = true end)
script.Parent.Unequipped:connect(function() wait() pickedup = false end)
& ayy i'm toastaindisguise/jswag |
|
|
| Report Abuse |
|
|
LucasLua
|
  |
| Joined: 18 Jun 2008 |
| Total Posts: 7386 |
|
|
| 10 Jan 2015 07:44 PM |
@verbal
Your script would stop working after picking it up - as in, if the player were to drop it again it would not start spinning again.
Furthermore it wouldn't stop spinning when they picked it up because it would only execute the lines that stop the while loop if the while loop has stopped, which it will never do. |
|
|
| Report Abuse |
|
|
|
| 10 Jan 2015 10:05 PM |
I tried yours @verbal, it span, but it still did not disable the spinning when it was picked up.
can anybody else help me? |
|
|
| Report Abuse |
|
|
| |
|