Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-2

LocalScripts aren't Working :/ Any Help?

Asked by 9 years ago

I made a Weapon Selection Gui and it Parents the Weapon Selected to the Player's Character, then inside the Tool I have a local script, inside I have an Animation and then I use the .Activated Event for Attacking, but for some reason, nothing Works even InGame! then I tried doing it manually, .Equipped and then .Button1Down and still the same Result :/ nothing in the Output, and everything is fine in my Script :/ if canAttack then canAttack = false Anim = Humanoid:LoadAnimation(animation) Anim:Play() etc etc... nothing works :/

Edit:

tool.Activated:connect(function()
    if canAttack then
        canAttack = false
        local Anim = hum:LoadAnimation(anim)
        Anim:Play()
        Anim:AdjustSpeed(0.5)
        if not canAttack then
            fist.Touched:connect(Damage)
        end
        wait(0.5)
        canAttack = true
    end
end)

Everything is defined

0
Perhaps your AnimationId is invalid? I still see a lot of variables that aren't defined in the given code. Is the entire script too long? Goulstem 8144 — 9y
0
about 10 lines of variables... I checked, I copied the Id's straight from my Develop page>Animations>Weapon Animation and then I thought, hmmm maybe I should do it properly? so I added http://roblox.com/asset/?id= still nothing worked :/ Kapitanovas 0 — 9y
0
also about 13 lines of the Damage Function Kapitanovas 0 — 9y

2 answers

Log in to vote
0
Answered by
Goulstem 8144 Badge of Merit Moderation Voter Administrator Community Moderator
9 years ago

We can't help you unless you post your script, sir. Some of the rest of your code may have errors in it, you never know. Also, could you supply an output, if there is any?

0
As I said, there is no Output :/ Kapitanovas 0 — 9y
Ad
Log in to vote
0
Answered by 9 years ago

Put the script in the tool and do this instead;

script.Parent.Activated:connect(function()
    if canAttack then
        canAttack = false
        local Anim = hum:LoadAnimation(--Where your animation is located)
        Anim:Play()
        Anim:AdjustSpeed(0.5)
        if not canAttack then
            fist.Touched:connect(Damage)
        end
        wait(0.5)
        canAttack = true
    end
end)

script.Parent.connect:(Activated)

I dunno if this will work because I need the whole script.

Answer this question