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: Glitched Animation with Tool?

Previous Thread :: Next Thread 
MightyDantheman is online. MightyDantheman
Joined: 06 May 2011
Total Posts: 5108
13 Mar 2016 09:07 PM
So I've got an animation that works great, until the player selects the tool. Meaning, if they dropped the tool and picked it up again, when you pick up, it's automatically selected. It works perfectly then, but when the player deselects the tool and reselects it, then things get buggy, weird, studdery, etc. It almost looks like the script was run twice in one click. Can someone tell me if this is ROBLOX or my script, and possible ways to fix this?


local tool = script.Parent
local num = 0.005
script.Parent:WaitForChild("CoolDown")
local x = script.Parent:FindFirstChild("CoolDown")
local plr = game.Players.LocalPlayer
local mouse = plr:GetMouse()
tool.GripUp = Vector3.new(0, 1, 0)

function onActivation()
if x.Value == 0 then
x.Value = 1
tool.GripUp = Vector3.new(0, 1, 0)
wait(num)
tool.GripUp = Vector3.new(0.243, 0.97, 0)
wait(num)
tool.GripUp = Vector3.new(0.447, 0.894, 0)
wait(num)
tool.GripUp = Vector3.new(0.6, 0.8, 0)
wait(num)
tool.GripUp = Vector3.new(1, 0, 0)
if mouse.Target and mouse.Target.Parent:FindFirstChild("Tree") then
mouse.Target.Parent:WaitForChild("Health")
local hp = mouse.Target.Parent:FindFirstChild("Health")
hp.Value = hp.Value - 10
end
wait(0.25)
tool.GripUp = Vector3.new(0.6, 0.8, 0)
wait(num)
tool.GripUp = Vector3.new(0.447, 0.894, 0)
wait(num)
tool.GripUp = Vector3.new(0.243, 0.97, 0)
wait(num)
tool.GripUp = Vector3.new(0, 1, 0)
wait(0.75)
x.Value = 0
end
end

tool.Activated:connect(onActivation)


--//


~MightyDantheman
Report Abuse
MightyDantheman is online. MightyDantheman
Joined: 06 May 2011
Total Posts: 5108
13 Mar 2016 09:11 PM
You can test it out for yourself in the game (while it's open):

http://www.roblox.com/games/331783664/Survival-Game-Test


~MightyDantheman
Report Abuse
MightyDantheman is online. MightyDantheman
Joined: 06 May 2011
Total Posts: 5108
13 Mar 2016 09:22 PM
Anyone?


~MightyDantheman
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
13 Mar 2016 09:43 PM
debounces are useful you know


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