|
| 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 |
|
|
|
| 27 Jun 2016 11:08 AM |
| Put your entire function before your script. |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 27 Jun 2016 02:11 PM |
please i really need help ;-:
|
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 27 Jun 2016 02:51 PM |
lol "local human = plr:FindFirstChildHumanoid"
This siggy is copyrighted © |
|
|
| Report Abuse |
|
|
pketny
|
  |
| Joined: 27 Dec 2010 |
| Total Posts: 1162 |
|
|
| 27 Jun 2016 02:53 PM |
Ye, he forgot to add ''
Just a typo |
|
|
| Report Abuse |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 27 Jun 2016 03:08 PM |
i understand but i've never worked on a script like this before
|
|
|
| Report Abuse |
|
|
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
|
  |
| 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
|
  |
| 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 |
|
|
| |
|