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: whys this only work once

Previous Thread :: Next Thread 
GreedTaka is not online. GreedTaka
Joined: 12 Dec 2014
Total Posts: 1503
23 Dec 2016 08:08 PM
this is in the roblox animation script.. in an npc.. couldnt get to work regularly so i changed onFreeFalls Animation id

-- connect events
Humanoid.Died:connect(onDied)
Humanoid.Running:connect(onRunning)
Humanoid.Jumping:connect(onJumping)
Humanoid.Climbing:connect(onClimbing)
Humanoid.GettingUp:connect(onGettingUp)
--Humanoid.FreeFalling:connect(onFreeFall) -- Block
Humanoid.FallingDown:connect(onFallingDown)
Humanoid.Seated:connect(onSeated)
Humanoid.PlatformStanding:connect(onPlatformStanding)
Humanoid.Swimming:connect(onSwimming)


game.ReplicatedStorage.Events.Block.OnServerEvent:connect(function() -- Npc Block
print'Running Animation'
onFreeFall()
end)

only works once, prints everytime the event is fired tho :/


Report Abuse
Gomlsauresrex is not online. Gomlsauresrex
Joined: 25 Mar 2016
Total Posts: 3588
23 Dec 2016 08:30 PM
where's the script that waits for the event to be called?

Post it.
Report Abuse
GreedTaka is not online. GreedTaka
Joined: 12 Dec 2014
Total Posts: 1503
23 Dec 2016 08:38 PM
its being called. that aint the problem cause it prints again even when it doesn't show the animation


game.ReplicatedStorage.Events.Block:FireServer()
Report Abuse
GreedTaka is not online. GreedTaka
Joined: 12 Dec 2014
Total Posts: 1503
23 Dec 2016 08:41 PM
its just the normal animation script


function playToolAnimation(animName, transitionTime, humanoid)
if (animName ~= toolAnimName) then

if (toolAnimTrack ~= nil) then
toolAnimTrack:Stop()
toolAnimTrack:Destroy()
transitionTime = 0
end

local roll = math.random(1, animTable[animName].totalWeight)
local origRoll = roll
local idx = 1
while (roll > animTable[animName][idx].weight) do
roll = roll - animTable[animName][idx].weight
idx = idx + 1
end
-- print(animName .. " * " .. idx .. " [" .. origRoll .. "]")
local anim = animTable[animName][idx].anim

-- load it to the humanoid; get AnimationTrack
toolOldAnimTrack = toolAnimTrack
toolAnimTrack = humanoid:LoadAnimation(anim)

-- play the animation
toolAnimTrack:Play(transitionTime)
toolAnimName = animName

currentToolAnimKeyframeHandler = toolAnimTrack.KeyframeReached:connect(toolKeyFrameReachedFunc)
end
end

function stopToolAnimations()
local oldAnim = toolAnimName

if (currentToolAnimKeyframeHandler ~= nil) then
currentToolAnimKeyframeHandler:disconnect()
end

toolAnimName = ""
if (toolAnimTrack ~= nil) then
toolAnimTrack:Stop()
toolAnimTrack:Destroy()
toolAnimTrack = nil
end


return oldAnim
end

-------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------


function onRunning(speed)
if speed>0 then
playAnimation("walk", 0.1, Humanoid)
pose = "Running"
else
playAnimation("idle", 0.1, Humanoid)
pose = "Standing"
end
end

function onDied()
pose = "Dead"
end

function onJumping()
playAnimation("jump", 0.1, Humanoid)
jumpAnimTime = jumpAnimDuration
pose = "Jumping"
end

function onClimbing()
playAnimation("climb", 0.1, Humanoid)
pose = "Climbing"
end

function onGettingUp()
pose = "GettingUp"
end

function onFreeFall()
playAnimation("fall", fallTransitionTime, Humanoid)
pose = "FreeFall"
end

function onFallingDown()
pose = "FallingDown"
end

function onSeated()
pose = "Seated"
end

function onPlatformStanding()
pose = "PlatformStanding"
end

function onSwimming(speed)
if speed>0 then
pose = "Running"
else
pose = "Standing"
end
end
Report Abuse
GreedTaka is not online. GreedTaka
Joined: 12 Dec 2014
Total Posts: 1503
23 Dec 2016 08:41 PM
all i did was add the fire server event and changed the id
Report Abuse
GreedTaka is not online. GreedTaka
Joined: 12 Dec 2014
Total Posts: 1503
23 Dec 2016 08:42 PM
https://www.roblox.com/item.aspx?id=584652448
Report Abuse
GreedTaka is not online. GreedTaka
Joined: 12 Dec 2014
Total Posts: 1503
23 Dec 2016 09:03 PM
b
Report Abuse
GreedTaka is not online. GreedTaka
Joined: 12 Dec 2014
Total Posts: 1503
23 Dec 2016 09:17 PM
b
Report Abuse
GreedTaka is not online. GreedTaka
Joined: 12 Dec 2014
Total Posts: 1503
23 Dec 2016 10:34 PM
bump
Report Abuse
GreedTaka is not online. GreedTaka
Joined: 12 Dec 2014
Total Posts: 1503
23 Dec 2016 11:43 PM
b
Report Abuse
GreedTaka is not online. GreedTaka
Joined: 12 Dec 2014
Total Posts: 1503
24 Dec 2016 01:05 AM
b
Report Abuse
GreedTaka is not online. GreedTaka
Joined: 12 Dec 2014
Total Posts: 1503
24 Dec 2016 01:28 AM
b
Report Abuse
GreedTaka is not online. GreedTaka
Joined: 12 Dec 2014
Total Posts: 1503
24 Dec 2016 02:17 AM
b
Report Abuse
Soybeen is not online. Soybeen
Joined: 17 Feb 2010
Total Posts: 21462
24 Dec 2016 02:21 AM
Stop all animations in the char at the beginning of your function and then play the desired one(s)


Report Abuse
GreedTaka is not online. GreedTaka
Joined: 12 Dec 2014
Total Posts: 1503
24 Dec 2016 02:31 AM
whats the script for that ;/
Report Abuse
Soybeen is not online. Soybeen
Joined: 17 Feb 2010
Total Posts: 21462
24 Dec 2016 02:39 AM
http://wiki.roblox.com/index.php?title=API:Class/Humanoid/GetPlayingAnimationTracks


Report Abuse
Soybeen is not online. Soybeen
Joined: 17 Feb 2010
Total Posts: 21462
24 Dec 2016 02:40 AM
http://wiki.roblox.com/index.php?title=API:Class/AnimationController/GetPlayingAnimationTracks


Report Abuse
GreedTaka is not online. GreedTaka
Joined: 12 Dec 2014
Total Posts: 1503
24 Dec 2016 02:46 AM
so i put it in the animate script?

i disabled and re enabled still dint work
Report Abuse
GNUnotUNIX is not online. GNUnotUNIX
Joined: 05 Feb 2012
Total Posts: 15171
24 Dec 2016 03:22 AM
@OP
You do know how to script right??
Report Abuse
GreedTaka is not online. GreedTaka
Joined: 12 Dec 2014
Total Posts: 1503
24 Dec 2016 03:47 AM
still only plays once

game.ReplicatedStorage.Events.Block.OnServerEvent:connect(function() -- Npc Block
onFreeFall()
script.Parent:WaitForChild("AnimationController")
for i,v in pairs(script.Parent.AnimationController:GetPlayingAnimationTracks()) do v:Stop() end
end)

learning lol
Report Abuse
GreedTaka is not online. GreedTaka
Joined: 12 Dec 2014
Total Posts: 1503
24 Dec 2016 12:23 PM
b
Report Abuse
GreedTaka is not online. GreedTaka
Joined: 12 Dec 2014
Total Posts: 1503
24 Dec 2016 03:22 PM
b
Report Abuse
booing is not online. booing
Joined: 04 May 2009
Total Posts: 6594
24 Dec 2016 03:23 PM
Other than "it doesn't work" why can't you use the Humanoid event? Are there any errors on client or server for the event or your approach?
Report Abuse
GreedTaka is not online. GreedTaka
Joined: 12 Dec 2014
Total Posts: 1503
24 Dec 2016 03:41 PM
i did..and no


justplays one gave u the script
Report Abuse
GreedTaka is not online. GreedTaka
Joined: 12 Dec 2014
Total Posts: 1503
24 Dec 2016 06:42 PM
:\;
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