#Weapon Ability Not Working

1 messages · Page 1 of 1 (latest)

worldly tapir
#

I'm making a weapon abilities, but the X move isn't working and weird stuff is happening with it.

elfin sluice
#

ok

#

first off

#

i reccomend u use modules

#

for building abilities

#

second

#

provide me with the local script

#

and a video of it

worldly tapir
#

ok

#
local equipped = false
local abilityevent = game.ReplicatedStorage.AbilityEvent
local uis = game.UserInputService

tool.Equipped:Connect(function()
    equipped = true
end)

tool.Unequipped:Connect(function()
    equipped = false
end)

uis.InputBegan:Connect(function(inp, proc)
    if not equipped then return end
    if proc then return end
    local mouse = game.Players.LocalPlayer:GetMouse()
    if inp.KeyCode == Enum.KeyCode.Z then
        abilityevent:FireServer("Z", mouse.Hit.Position)
    elseif inp.KeyCode == Enum.KeyCode.X then
        abilityevent:FireServer("X", mouse.Hit.Position)
    end
end)```
#

the z move works perfectly fine but stops working when i use the x move

#

when i use the z move the x move doesnt do anything

elfin sluice
#

@worldly tapir

#

ur tweens r wrong

#

also what is this??: while number <= 0.01

#

the number starts at 1

#

also why r u using RaycastResult.Normal.X/Y/Z in CFrame.Angles

worldly tapir
#

im not good at raycasts

last flaxBOT
#

studio** You are now Level 4! **studio

worldly tapir
#

well can u help instead of just pointing out everything i did wrong