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

How do i make the arm have if someone touches it or it hits someone it will takedamage off them?

Asked by 8 years ago
local Master = game.Players.LocalPlayer
Character = Master.Character
local enabled = true
Player = script.Parent.Parent
me = Player
mouse = Player:GetMouse()
Player = script.Parent.Parent
Character = Player.Character
run = game:GetService("RunService")
waittime = 4
LeftShoulder = Player.Character.Torso["Left Shoulder"]
RightShoulder =   Player.Character.Torso["Right Shoulder"]
LeftArm = me.Character["Left Arm"]
RightArm = me.Character["Right Arm"]
LeftLeg = me.Character["Left Leg"]
RightLeg = me.Character["Right Leg"]
Torso = me.Character["Torso"]
Colour = BrickColor.new("Bright orange")

function onKeyDown(key) 
    key = key:lower() 
    if key == "f" then 
        run = game:GetService("RunService")
        game:GetService("Chat"):Chat(Player.Character.Head, "Fist Shot")
        local anim = Player.Character.Humanoid:LoadAnimation(script.Animation)
        anim:Play()

end
end 
mouse.KeyDown:connect(onKeyDown)

The animation is a arm going out and i need that arm to have damage, i've dried some things, but it just breaks the whole script. Btw i know most of that stuff at the top is unneeded, but that's not the reason it's not working. it works when i don't have any damage "Script" in it.

0
When using GetMouse() call it on Master instead of player, and try using color instead of colour Xoqex 75 — 8y
0
Colour is a variable so it doesn't matter, And the mouse is already done, i've already got the damage done now although a problem has occured with it damaging it multiple times due to the animation but it's all good :3 blestdude 0 — 8y

Answer this question