Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

LocalScripts aren't Working :/ Any Help?

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

3 comments

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?

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 :/

0

also about 13 lines of the Damage Function

2 answers

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?

1 comment

0

As I said, there is no Output :/

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.

This discussion is preserved as it was. New answers, comments, and votes are closed.