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

I made a roblox script about a attack doge for my friend is it wrong?

Asked by
kmar_yt -2
3 years ago

local access = (“friend, or person”) game.ReplicatedStorage = Player.PlayerAdded() Local doge =game.Player(function(player) end)

0
Srry I’m new idk how to do this stuff kmar_yt -2 — 3y
0
what is this code? Tizzel40 243 — 3y
0
I don't think you even know the basics, go on youtube and search up a scripting tutorial and learn the basics CelticFury600 4 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago

It depends on what you NEED. If you want a attack on touch script, you can follow this: (Expecting that the doge follows any player)

-- LocalScript
script.Parent.Touched:connect(function(part)
    if part.Parent:FindFirstChild("Humanoid") then
        part.Parent.Humanoid:TakeDamage(30)
end)
-- this script makes the parent of it (assuming your localscript for damage is inside a part) deal "30" damage (which can be changed to whatever you like)
-- you have to put this localscript in a part, so whenever that part touches the player, the player gets -30 (or any value) damage.

Let me know if there is something wrong!

Ad

Answer this question