Damage Script Roblox Studio

Posted on

Damage is a term used to refer to when a ExplorerImageIndex 12Players’ ExplorerImageIndex 9Humanoid’s Health property is reduced by a script. When a humanoid gets zero health, so the humanoid will dies. Then, all joints in the model are broken causing the humanoid fall apart.

Damage is able to be modified by a script with an event that checks for the humanoid taking damage. This is able to cause taken damage to be reduced or even negated. In the text below, this is the script for kicking animation. You are able to deal damage whenever the players right leg (the one in the animation) hits another player.


local Player = game.Players.LocalPlayer

local Character = Player.Character or Player.CharacterAdded:wait()

local Humanoid = Character:WaitForChild(“Humanoid”)

local Mouse = Player:GetMouse()

local kicking = Instance.new(“Animation”, Humanoid)

kicking.AnimationId = “http://www.roblox.com/item.aspx?id=273619670”

local function keyDown(key)

key = key:lower()

if key == ‘t’ then

local animTrack = Humanoid:LoadAnimation(kicking)

animTrack:Play()

end

end

Mouse.KeyDown:connect(keyDown)

Well, the text above is script that you can use to deal damage like kicking the animation. Now, you are able to try using those scripts.

HOW TO MAKE A DEATH BLOCK WITH SCRIPT IN ROBLOX STUDIO

After you know the script to kicking animation, now you may want to know how to make a death block with script in Roblox Studio. To do that, you are able to follow these steps below:

  • At the first step, you have to open Roblox Develop.
  • The next step, you need to click at Create New Place.
  • Then, you are able to select your game template. You are able to select the normal baseplate.
  • The next step that you have to do is to insert a part into your game and adjust the size (if you would like).
  • Afterwards, you need to right-click on your part and hover your cursor over “Insert Object,” and then click “Script.”
  • The last step, you have to delete the print (‘Hello world!’) part script and replace it with the code.

TYPES OF DAMAGE

ENVIRONMENTAL

Environmental damage is damage which cannot be configured in any way by a place creator. The only type of environmental damage which currently exists in Roblox platform is world border damage that causes a Robloxian to die if they go too close to the skybox. The most common example of this environmental damage is when a Robloxian falls off a brick into the bottom of the Robloxian world. After a few seconds, so the Robloxian will die. But, the maximal distance that the player can fall down is able to be edited by the Developers. The maximal distance is -50000, though by default it is -500.

LOCAL

Local damage is damage which can be caused by elements. It is able to be modified by a place creator. In this time, only scripts are able to make damage. Local damage is able to be effected on humanoids by scripts by applying the Take Damage method, or by manually setting. But, doing Take Damage will not damage the humanoid if there is a ExplorerImageIndex 37ForceField present in the character. If the health is set to 0 or less, so the Died event will call.

Leave a Reply

Your email address will not be published. Required fields are marked *