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: Why is this script not working?

Previous Thread :: Next Thread 
Cordeliaz is not online. Cordeliaz
Joined: 06 Jul 2012
Total Posts: 17898
27 Dec 2016 05:42 AM
local animation = Instance.new("Animation")
animation.AnimationId = "rbxassetid://589209170"
local plr = game.Players.LocalPlayer
local m = plr:GetMouse()

local trackanimation = nil
local playability = true
local debounce = false
m.KeyDown:connect(function(key)
if debounce == false then
debounce = true
key = key:lower()
if key == "x" then
if playability == true then
trackanimation = plr.Character.Humanoid:LoadAnimation(animation)
trackanimation.KeyframeReached:connect(function()
print('Working')
end)
trackanimation:Play()
plr.Character.Humanoid.Jump = true
wait(0.5)
plr.PlayerGui.SG.FrontFlip.Visible = true

local gui = plr.PlayerGui.SG.FrontFlip
local money = plr.leaderstats.Coins

money.Value = money.Value + 20 --Change 20 to how many coins will the player get
local now = money.Value


gui.Visible = true
gui.Text = "You now have "..now.." coins"

wait(0.5)
gui.Visible = false
end
end
end
wait (45)
debounce = false
end)


https://www.roblox.com/Trade/TradeWindow.aspx?TradePartnerID=29488128 ✔️👌🏼UPGRADING EVERYTHING✔️👌🏼👌🏼 I ALWAYS COUNTER, I NEVER DECLINE✔️👌🏼 NEVER BE AFRAID TO SEND! ✔️👌🏼👌🏼
Report Abuse
Cordeliaz is not online. Cordeliaz
Joined: 06 Jul 2012
Total Posts: 17898
27 Dec 2016 06:03 AM
this script should perform a frontflip when i press key X and it should give me coins and it has a cooldown


https://www.roblox.com/Trade/TradeWindow.aspx?TradePartnerID=29488128 ✔️👌🏼UPGRADING EVERYTHING✔️👌🏼👌🏼 I ALWAYS COUNTER, I NEVER DECLINE✔️👌🏼 NEVER BE AFRAID TO SEND! ✔️👌🏼👌🏼
Report Abuse
Arti_BLOX is online. Arti_BLOX
Joined: 17 Mar 2013
Total Posts: 91
27 Dec 2016 06:08 AM
If I am correct, you cannot play an animation that you didn't create, unless you have created it with a Team Create with someone else..
I will look into the script again, and if I find a problem or not I will reply back.


#code --Please don't spam me about Building, I will do it when I have energy, P.S: School is not over for me yet... ;(
Report Abuse
Cordeliaz is not online. Cordeliaz
Joined: 06 Jul 2012
Total Posts: 17898
27 Dec 2016 06:09 AM
The animation works, its a group animation and it works when im running and jumping
however that script doesnt work


https://www.roblox.com/Trade/TradeWindow.aspx?TradePartnerID=29488128 ✔️👌🏼UPGRADING EVERYTHING✔️👌🏼👌🏼 I ALWAYS COUNTER, I NEVER DECLINE✔️👌🏼 NEVER BE AFRAID TO SEND! ✔️👌🏼👌🏼
Report Abuse
Arti_BLOX is online. Arti_BLOX
Joined: 17 Mar 2013
Total Posts: 91
27 Dec 2016 06:17 AM
Hmm.. I don't see a problem with the script.. I will look into it with my friends if they know, one of them will prob know 100%.


#code --Please don't spam me about Building, I will do it when I have energy, P.S: School is not over for me yet... ;(
Report Abuse
Cordeliaz is not online. Cordeliaz
Joined: 06 Jul 2012
Total Posts: 17898
27 Dec 2016 06:20 AM
test in in your game
it doesnt work :/


https://www.roblox.com/Trade/TradeWindow.aspx?TradePartnerID=29488128 ✔️👌🏼UPGRADING EVERYTHING✔️👌🏼👌🏼 I ALWAYS COUNTER, I NEVER DECLINE✔️👌🏼 NEVER BE AFRAID TO SEND! ✔️👌🏼👌🏼
Report Abuse
Arti_BLOX is online. Arti_BLOX
Joined: 17 Mar 2013
Total Posts: 91
27 Dec 2016 06:22 AM
It wouldn't work for me anyways if the script was correct, I am not in your group and I have no permission to use the item..


#code --Please don't spam me about Building, I will do it when I have energy, P.S: School is not over for me yet... ;(
Report Abuse
Cordeliaz is not online. Cordeliaz
Joined: 06 Jul 2012
Total Posts: 17898
27 Dec 2016 06:48 AM
ugh


https://www.roblox.com/Trade/TradeWindow.aspx?TradePartnerID=29488128 ✔️👌🏼UPGRADING EVERYTHING✔️👌🏼👌🏼 I ALWAYS COUNTER, I NEVER DECLINE✔️👌🏼 NEVER BE AFRAID TO SEND! ✔️👌🏼👌🏼
Report Abuse
Arti_BLOX is online. Arti_BLOX
Joined: 17 Mar 2013
Total Posts: 91
27 Dec 2016 08:24 AM
Is this localscript or a normal script?


#code --Please don't spam me about Building, I will do it when I have energy, P.S: School is not over for me yet... ;(
Report Abuse
Arti_BLOX is online. Arti_BLOX
Joined: 17 Mar 2013
Total Posts: 91
27 Dec 2016 08:28 AM
If Normal it won't work, if LocalScript Replace the code with this:

local animation = Instance.new("Animation")
animation.AnimationId = "rbxassetid://589209170"
local plr = game.Players.LocalPlayer
local m = plr:GetMouse()
if m == nil then
repeat
m = plr:GetMouse()
wait(0.01)
until m ~= nil
end
local trackanimation = nil
local playability = true
local debounce = false
m.KeyDown:connect(function(key)
if debounce == false then
debounce = true
key = key:lower()
if key == "x" then
if playability == true then
trackanimation = plr.Character.Humanoid:LoadAnimation(animation)
trackanimation.KeyframeReached:connect(function()
print('Working')
end)
trackanimation:Play()
plr.Character.Humanoid.Jump = true
wait(0.5)
plr.PlayerGui.SG.FrontFlip.Visible = true

local gui = plr.PlayerGui.SG.FrontFlip
local money = plr.leaderstats.Coins

money.Value = money.Value + 20 --Change 20 to how many coins will the player get
local now = money.Value


gui.Visible = true
gui.Text = "You now have "..now.." coins"

wait(0.5)
gui.Visible = false
end
end
end
wait (45)
debounce = false
end)

Now, it will keep seraching for mouse if its not there.
Reply if problems. (Show Output Please)


#code --Please don't spam me about Building, I will do it when I have energy, P.S: School is not over for me yet... ;(
Report Abuse
Cordeliaz is not online. Cordeliaz
Joined: 06 Jul 2012
Total Posts: 17898
27 Dec 2016 08:31 AM
its a local one
thanks dude ill see if it works


https://www.roblox.com/Trade/TradeWindow.aspx?TradePartnerID=29488128 ✔️👌🏼UPGRADING EVERYTHING✔️👌🏼👌🏼 I ALWAYS COUNTER, I NEVER DECLINE✔️👌🏼 NEVER BE AFRAID TO SEND! ✔️👌🏼👌🏼
Report Abuse
Cordeliaz is not online. Cordeliaz
Joined: 06 Jul 2012
Total Posts: 17898
27 Dec 2016 08:35 AM
rip it doesnt and the output doesnt show any signs of errors too
well i already got a new idea but thanks for trying to help


https://www.roblox.com/Trade/TradeWindow.aspx?TradePartnerID=29488128 ✔️👌🏼UPGRADING EVERYTHING✔️👌🏼👌🏼 I ALWAYS COUNTER, I NEVER DECLINE✔️👌🏼 NEVER BE AFRAID TO SEND! ✔️👌🏼👌🏼
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