Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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

3 comments

0

Srry I’m new idk how to do this stuff

0

what is this code?

0

I don't think you even know the basics, go on youtube and search up a scripting tutorial and learn the basics

1 answer

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!

This discussion is preserved as it was. New answers, comments, and votes are closed.