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

how to add a part that deals damage and make it spawn in front of a player and humaniod?

Asked by
micmnm4 18
7 years ago

I am trying to add skills in my RPG game but I dont know how.

1 answer

Log in to vote
0
Answered by
farrizbb 465 Moderation Voter
7 years ago
Edited 7 years ago
local z = Instance.new("Part")
z.Parent = game.Workspace
z.Name = "yojo"
z.CFrame = game.Players.LocalPlayers.Character.Torso
--this part you need a killing script in your game to insert it into the part
UserInput.InputBegan:Connect(onKey)
game.Workspace:WaitForChild("yojo") 
function z ()
    repeat

local c = game.Workspace.killscriptnamehere:Clone()

c.Name = "kill script"

c.Parent = game.Workspace:WaitForChild("yojo")
wait(3)
    until game.StarterPack.Part.Anchored == true --put a part that isnt anchored in StarterPack
end
bb()
--kill script put in workspace
local debounce = true
script.Parent.Touched:connect(function(hit)
    if debounce == true then
        debounce = false
        local x = hit.Parent:FindFirstChild("Humanoid")
           if x then
            x.Health = x.Health-15
            wait(1)
           end
        debounce = true
    end
end)

0
Showing him a attack script won't help, but showing him HOW to do it will. Just giving you a heads-up SwordsDestinyGames -11 — 7y
Ad

Answer this question