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

How i can script punch that can be in starter pack? [closed]

Asked by 4 years ago

i want punch with changeable damage. nothing else

0
Let me try it dood. Foxy_Developer 111 — 4y
0
this is not a request site. we only help you with code, we can't make you code. bluzorro 417 — 4y
0
I make it. Idk why the people can't help in to create a code? What is the problem? Foxy_Developer 111 — 4y
0
@Foxy_Developer Most times they just copy and ignore anything you written in the code, and only looks to the code if it errors Leamir 3138 — 4y
View all comments (4 more)
0
Yeah, you are right. That the why I explain it first. If they only copy and paste well... They're dumb. Bc there's someone helping them to be a beter scripter and theu ignore him. Foxy_Developer 111 — 4y
0
Well im not that dumb. i read EVERYTHING but i never understand everything, but this means learning i think? bukjesieni -8 — 4y
0
Yeah, thanks for read the explanaiton it tooks me 8min to write all, Foxy_Developer 111 — 4y
0
If they copy and paste the code that menas that you wasted your time hiimgoodpack 2009 — 4y

Closed as Not Constructive by Leamir, firestarroblox123, and hiimgoodpack

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

1 answer

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

Ok, lets try it!

First Step : We need to know where's our animation. And how we already script that. So first of all we need to know how to activate a animation

local animation = Instance.new("Animation")
local id = 069706
animation.AnimationId = id

animation:Play()
wait(3)
animation:Stop()

That's a easy script for play a Animation. So lets see how to make damage with the animation!

Second Step : We need to know how to use the "function()" so lets try a chunk of code! It will be easy and explained so you can undertand it!

Third Step : We need to know how to use the debounce and where we have to use it! So the animation will runs perfectly and the damage will be taked only one time per hit!

Fourth Step : Enjoy coding! You always have to enjoy what are you doing! Play some music while you script or even you can play a game before so you will be relaxed.

Lets get into the code!

--> Locals <--

local damage = 25
local debounce = false

--> Code <--

local function onTouched(hit)
    local character = hit.Parent
    if character then
        local humanoid = character:WaitForChild("Humanoid")
        if humanoid then
            if not debounce then
                humanoid.Health = humanoid.Health - 
            end
        end
    end
    debounce = true
    wait(6) --> The time you want to wait so the character will not take a lot of damage in one                     hit
    debounce = false
end

-->Lets connect it so it works!
script.Parent:Touched:Connect(onTouched)

That's how we make a script so the character will get damage. And we add a debounce so the character will not take a lot of damage [The hit function is sensible] in one hit.

I hope my answer already solve your question. If it likes that please accept my answer. So you let me know that works for you!

Keep scripting!

0
Okay but i have the next problem. where i must put in the scripts? bukjesieni -8 — 4y
0
Sorry for it, im a complete vegetable with scripting but i want to start with something. Really appreciate it. :D bukjesieni -8 — 4y
0
Put in into the Punch Animation Script that you already have, And that's all! Please accept my answer if it solved your question! Foxy_Developer 111 — 4y
0
But i dont have any of scripts of punch animation. i dont know is it local script or script and where to put it bukjesieni -8 — 4y
View all comments (9 more)
0
*Sight*, first you have to make a Animation Script so the animation will run when the player press any key or do something. Then you create a Script int the AnimationScript and you put the chunk of code I made into the Script. And that's all. Foxy_Developer 111 — 4y
0
But where i must put it, ServerStorage?, Server\ bukjesieni -8 — 4y
0
Okay. i did the 2 scripts. but there are on workspace. i dont know where to put them that they will work bukjesieni -8 — 4y
0
You can put them on RS or SS [ReplicatedStorage or ServerStorage] even you can put them in ServerScriptService! Foxy_Developer 111 — 4y
0
They arent working, so i must did something wrong. next is that they must be script, local script, or module script? bukjesieni -8 — 4y
0
The AnimationScript have to be a LocalScript, and the Damage a nomal Script. Foxy_Developer 111 — 4y
0
Welp dont work but thanks for help anyway bukjesieni -8 — 4y
0
Search any tutorial on Youtube. Or you can also add me on discord [Username : Sharky_Dev, Tag : #7032] Foxy_Developer 111 — 4y
0
Added bukjesieni -8 — 4y
Ad