I'm trying to make a jumping animation/sprite, I wanted to make it so whenever the player taps the spacebar the sprite plays.
How the script is supposed to work: When the spacebar is pressed the id's are supposed to cycle though while the player is jumping, making the sprite. Here is my failed attempt.
01 | JumpingID = "http://www.roblox.com/asset/?id=6588763600" -- Ids |
02 | JumpingID 1 = "http://www.roblox.com/asset/?id=6596998485" |
03 | JumpingID 2 = "http://www.roblox.com/asset/?id=6597000062" |
04 | JumpingID 3 = "http://www.roblox.com/asset/?id=6597008331" |
05 | JumpingID 4 = "http://www.roblox.com/asset/?id=6597011900" |
06 | JumpingID 5 = "http://www.roblox.com/asset/?id=6597012454" |
07 | JumpingID 6 = "http://www.roblox.com/asset/?id=6597013053" |
08 | JumpingID 7 = "http://www.roblox.com/asset/?id6597013593=" |
09 |
10 | jumping = false |
11 | UserInputService = game:GetService( "UserInputService" ) |
12 | local hum = script.Parent.Parent:FindFirstChild( "Humanoid" ) |
13 | local pose 2 = script.Parent:FindFirstChild( "PoseBooltest1" ) |
14 | local df = script.Parent.Front 2. Front 2 |
15 | local go = false |
At line 08, U mispelt and made ?idblahblah= instead of ?id=blahblah
01 | local UserInputService = game:GetService( "UserInputService" ) |
02 | local df = script.Parent.Front 2. Front 2 |
03 |
04 | local tab,i,debounce = { 6588763600 , 6596998485 , 6597000062 , 6597008331 , 6597011900 , |
05 | 6597011900 , 6597011900 , 6597011900 , 6597012454 , 6597013053 , 6597013593 } , 1 , false |
06 | UserInputService.InputBegan:Connect( function (input) |
07 | if debounce then return end |
08 | if input.KeyCode = = Enum.KeyCode.Space then |
09 | debounce = true |
10 | df.Image = "rbxassetid://" ..tab [ i ] |
11 | wait( 3 ) |
12 | i = i<#tab and i+ 1 or 1 |
13 | debounce = false |
14 | end |
15 | end ) |
Click play, open workspace then click ur username in worspace, it should have a script called animate. Copy animate and its children then stop the game. Paste the animate script and its children into startercharacterscripts inside starter player. You can change the jump animation by editing that script and putting the ID there.
For your informaition:
The animate script's children are values so that the script can copy the id from the values then use the animation.