generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: script wont do any damage to people

Previous Thread :: Next Thread 
Apollo_Shine is not online. Apollo_Shine
Joined: 08 Jun 2016
Total Posts: 15
27 Jun 2016 11:08 AM
#code local plr = game.Players.LocalPlayer
local char = plr.Character or plr.CharacterAdded:wait()
local mouse = plr:GetMouse()

local torso = char:WaitForChild("Torso")

function Blast (key)
key = key:lower()
if key == "z" then
local hs = Instance.new("Part",game.Workspace)
hs.CanCollide = false
hs.Shape = "Ball"
hs.BrickColor = BrickColor.new("Really red")
hs.Transparency = 0/5
hs.Size = Vector3.new(5,5,5) --yeah my name is bushido and my destiny is to be me
hs.TopSurface = "Smooth" --smooth like me
hs.BottomSurface = "Smooth" --again like me i got the smooth moves
hs.CFrame = torso.CFrame*CFrame.new(0,0,-6)
local f = Instance.new("Fire",hs)
f.Heat = 0
f.Size = 12
local bv = Instance.new("BodyVelocity",hs)
bv.maxForce = Vector3.new(math.huge,math.huge,math.huge)
bv.Velocity = torso.CFrame.lookVector*80
end
end

mouse.KeyDown:connect(Blast)


basically everything i try the thing wont do damage, all it does is make the health bar disappear. it's suppose to shoot a fireball.


Report Abuse
myactivetestplace is not online. myactivetestplace
Joined: 11 Jul 2015
Total Posts: 3733
27 Jun 2016 11:08 AM
Put your entire function before your script.
Report Abuse
Apollo_Shine is not online. Apollo_Shine
Joined: 08 Jun 2016
Total Posts: 15
27 Jun 2016 11:18 AM
it didnt work here is my function:

function touch(hit)
doo = hit.Parent:FindFirstChild("dooanoid")
if doo ~= nil then
doo:TakeDamage(math.huge)--change this
end
end
script.Parent.Touched:connect(touch)




Report Abuse
Apollo_Shine is not online. Apollo_Shine
Joined: 08 Jun 2016
Total Posts: 15
27 Jun 2016 02:11 PM
please i really need help ;-:


Report Abuse
XMegaInfernapeX is not online. XMegaInfernapeX
Joined: 20 Feb 2011
Total Posts: 488
27 Jun 2016 02:48 PM
function touch(hit)
doo = hit.Parent:FindFirstChild("dooanoid")
if doo ~= nil then
doo:TakeDamage(math.huge)--change this
end
end

script.Parent.Touched:connect(function(hit)
local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
local human = plr:FindFirstChildHumanoid
if plr and human then
human:TakeDamage(human.MaxHealth)
end
end
Report Abuse
XMegaInfernapeX is not online. XMegaInfernapeX
Joined: 20 Feb 2011
Total Posts: 488
27 Jun 2016 02:48 PM
Woops i meant this

script.Parent.Touched:connect(function(hit)
local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
local human = plr:FindFirstChildHumanoid
if plr and human then
human:TakeDamage(human.MaxHealth)
end
end)

USE THAT ONE, NOT BOTH
Report Abuse
killerbot29003 is not online. killerbot29003
Joined: 04 Oct 2014
Total Posts: 3054
27 Jun 2016 02:51 PM
lol
"local human = plr:FindFirstChildHumanoid"


This siggy is copyrighted ©
Report Abuse
pketny is not online. pketny
Joined: 27 Dec 2010
Total Posts: 1162
27 Jun 2016 02:53 PM
Ye, he forgot to add ''

Just a typo
Report Abuse
Apollo_Shine is not online. Apollo_Shine
Joined: 08 Jun 2016
Total Posts: 15
27 Jun 2016 03:03 PM
just checking so this should work now?

local plr = game.Players.LocalPlayer
local char = plr.Character or plr.CharacterAdded:wait()
local mouse = plr:GetMouse()

local torso = char:WaitForChild("Torso")

function Blast (key)
key = key:lower()
if key == "z" then
local hs = Instance.new("Part",game.Workspace)
hs.CanCollide = false
hs.Shape = "Ball"
hs.BrickColor = BrickColor.new("Really red")
hs.Transparency = 0/5
hs.Size = Vector3.new(5,5,5) --yeah my name is bushido and my destiny is to be me
hs.TopSurface = "Smooth" --smooth like me
hs.BottomSurface = "Smooth" --again like me i got the smooth moves
hs.CFrame = torso.CFrame*CFrame.new(0,0,-6)
local f = Instance.new("Fire",hs)
f.Heat = 0
f.Size = 12
local bv = Instance.new("BodyVelocity",hs)
bv.maxForce = Vector3.new(math.huge,math.huge,math.huge)
bv.Velocity = torso.CFrame.lookVector*80
end
end

mouse.KeyDown:connect(Blast)



script.Parent.Touched:connect(function(hit)
local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
"local human = plr:FindFirstChildHumanoid"
if plr and human then
human:TakeDamage(human.MaxHealth)
end
end)


Report Abuse
pketny is not online. pketny
Joined: 27 Dec 2010
Total Posts: 1162
27 Jun 2016 03:05 PM
I don't think you understand what you're doing at all...

Make sure you have followed all of these tutorials before trying to script anything:

http://wiki.roblox.com/index.php?title=AllTutorials

https://www.lua.org/pil/1.html

And have browsed the wiki for a while.
Report Abuse
Apollo_Shine is not online. Apollo_Shine
Joined: 08 Jun 2016
Total Posts: 15
27 Jun 2016 03:08 PM
i understand but i've never worked on a script like this before


Report Abuse
peIicans is not online. peIicans
Joined: 02 Nov 2013
Total Posts: 1148
27 Jun 2016 03:12 PM
local plr = game.Players.LocalPlayer
local char = plr.Character or plr.CharacterAdded:wait()
local mouse = plr:GetMouse()

local torso = char:WaitForChild("Torso")

function Blast (key)
key = key:lower()
if key == "z" then
local hs = Instance.new("Part",game.Workspace)
hs.CanCollide = false
hs.Shape = "Ball"
hs.BrickColor = BrickColor.new("Really red")
hs.Transparency = 0/5
hs.Size = Vector3.new(5,5,5) --yeah my name is bushido and my destiny is to be me
hs.TopSurface = "Smooth" --smooth like me
hs.BottomSurface = "Smooth" --again like me i got the smooth moves
hs.CFrame = torso.CFrame*CFrame.new(0,0,-6)
local f = Instance.new("Fire",hs)
f.Heat = 0
f.Size = 12
local bv = Instance.new("BodyVelocity",hs)
bv.maxForce = Vector3.new(math.huge,math.huge,math.huge)
bv.Velocity = torso.CFrame.lookVector*80

hs.Touched:connect(function(hit)
local human = hit.Parent:WaitForChild("Humanoid")
if human ~= nil then
human.Health:TakeDamage(math.huge)
end
end)
end
end

mouse.KeyDown:connect(Blast)


Report Abuse
peIicans is not online. peIicans
Joined: 02 Nov 2013
Total Posts: 1148
27 Jun 2016 03:18 PM
add this under local hs = insta...blah


game.Debris:AddItem(hs, 2) -- number is how long the fireball will last before deleting


Report Abuse
elifire2 is not online. elifire2
Joined: 10 Mar 2012
Total Posts: 236
27 Jun 2016 03:23 PM
Have you identified how much damage it would do?

ei: Damage = 50
Report Abuse
Apollo_Shine is not online. Apollo_Shine
Joined: 08 Jun 2016
Total Posts: 15
27 Jun 2016 03:24 PM
ya


Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image