I am trying to add skills in my RPG game but I dont know how.
✓ ANSWER ACCEPTED
how to add a part that deals damage and make it spawn in front of a player and humaniod?
1 answer
✓ Accepted answer
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)
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
Showing him a attack script won't help, but showing him HOW to do it will. Just giving you a heads-up