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 » Scripting Helpers
Home Search
 

Re: kil script speed

Previous Thread :: Next Thread 
johnbon1 is not online. johnbon1
Joined: 01 Feb 2014
Total Posts: 173
30 Sep 2014 08:10 PM
ok so I got a kill script to work but it makes the bullet like go through people sometimes and in general the bullet doesn't always kill when it hits. this part of the script is the problem because the problem is not there when this part is gone. can anybody explain why this would affect a bullet?

ball = script.Parent
function onTouched(hit)
local humanoid = hit.Parent:findFirstChild("Humanoid")


if humanoid ~= nil then
tagHumanoid(humanoid)
humanoid.Health = humanoid.Health - damage
wait(2)
untagHumanoid(humanoid)
end

connection:disconnect()
ball.Parent = nil
end

function tagHumanoid(humanoid)
-- todo: make tag expire
local tag = ball:findFirstChild("creator")
if tag ~= nil then
local new_tag = tag:clone()
new_tag.Parent = humanoid
end
end


function untagHumanoid(humanoid)
if humanoid ~= nil then
local tag = humanoid:findFirstChild("creator")
if tag ~= nil then
tag.Parent = nil
end
end
end

connection = ball.Touched:connect(onTouched)

wait(1)
ball.Parent = nil
Report Abuse
johnbon1 is not online. johnbon1
Joined: 01 Feb 2014
Total Posts: 173
30 Sep 2014 08:15 PM
bump1
Report Abuse
johnbon1 is not online. johnbon1
Joined: 01 Feb 2014
Total Posts: 173
30 Sep 2014 08:19 PM
plz script helpers
Report Abuse
johnbon1 is not online. johnbon1
Joined: 01 Feb 2014
Total Posts: 173
30 Sep 2014 08:28 PM
plz scripters :[
Report Abuse
Lucas1270z is not online. Lucas1270z
Joined: 27 Feb 2013
Total Posts: 439
01 Oct 2014 10:27 AM
"humanoid.Health = humanoid.Health - damage" tries to subtract the damage variable from humanoid, and the variable "damage" isnt defined, so add local damage = 20(or any other)
Report Abuse
johnbon1 is not online. johnbon1
Joined: 01 Feb 2014
Total Posts: 173
02 Oct 2014 04:51 PM
so I changed your quote from the original script to...

humanoid.Health = humanoid.Health - local damage = 100

however local is underlined in read, did I add it correctly?

if not sorry I am not an amazing scripter lol.
Report Abuse
johnbon1 is not online. johnbon1
Joined: 01 Feb 2014
Total Posts: 173
02 Oct 2014 05:04 PM
oh, I hadn't included the full part of the script.. let me repost:

local db = false

script.Parent.Touched:connect(function(h)
if db then return end
db = true
local hum = h.Parent:FindFirstChild("Humanoid")
if hum then h.Parent:BreakJoints() end
db = false
end)

ball = script.Parent
function onTouched(hit)
local humanoid = hit.Parent:findFirstChild("Humanoid")


if humanoid ~= nil then
tagHumanoid(humanoid)
humanoid.Health = humanoid.Health - damage
wait(2)
untagHumanoid(humanoid)
end

connection:disconnect()
ball.Parent = nil
end

function tagHumanoid(humanoid)
-- todo: make tag expire
local tag = ball:findFirstChild("creator")
if tag ~= nil then
local new_tag = tag:clone()
new_tag.Parent = humanoid
end
end


function untagHumanoid(humanoid)
if humanoid ~= nil then
local tag = humanoid:findFirstChild("creator")
if tag ~= nil then
tag.Parent = nil
end
end
end

connection = ball.Touched:connect(onTouched)

wait(1)
ball.Parent = nil
Report Abuse
eLunate is not online. eLunate
Joined: 29 Jul 2014
Total Posts: 13268
02 Oct 2014 05:08 PM
Keep your script, but all the way at the top add
local damage = 100
Report Abuse
johnbon1 is not online. johnbon1
Joined: 01 Feb 2014
Total Posts: 173
02 Oct 2014 05:13 PM
ah ok thanks ill test
Report Abuse
johnbon1 is not online. johnbon1
Joined: 01 Feb 2014
Total Posts: 173
02 Oct 2014 05:32 PM
it still seems to cause the script to make a bullet just go through a person comparative to the script without the bottom part where it doesn't go through people and quite literally breaks joints as the script dictates (afaik)
Report Abuse
CatInvictus is not online. CatInvictus
Joined: 25 Apr 2009
Total Posts: 1872
02 Oct 2014 05:38 PM
idk man but here is a free bumb
Report Abuse
Wyvernswordmaster is not online. Wyvernswordmaster
Joined: 18 Oct 2006
Total Posts: 2392
02 Oct 2014 05:58 PM
yikes someone help him
Report Abuse
johnbon1 is not online. johnbon1
Joined: 01 Feb 2014
Total Posts: 173
02 Oct 2014 05:58 PM
D:
Report Abuse
eLunate is not online. eLunate
Joined: 29 Jul 2014
Total Posts: 13268
02 Oct 2014 06:01 PM
It's easily fixed by like, not using a bullet and instead resorting to hitscan/raycasting
Report Abuse
johnbon1 is not online. johnbon1
Joined: 01 Feb 2014
Total Posts: 173
02 Oct 2014 06:03 PM
no earthly idea what that even is
Report Abuse
Wyvernswordmaster is not online. Wyvernswordmaster
Joined: 18 Oct 2006
Total Posts: 2392
02 Oct 2014 06:05 PM
i would give up tbh
Report Abuse
johnbon1 is not online. johnbon1
Joined: 01 Feb 2014
Total Posts: 173
02 Oct 2014 06:06 PM
noo this is important
Report Abuse
Wyvernswordmaster is not online. Wyvernswordmaster
Joined: 18 Oct 2006
Total Posts: 2392
02 Oct 2014 06:17 PM
eh.
Report Abuse
johnbon1 is not online. johnbon1
Joined: 01 Feb 2014
Total Posts: 173
04 Oct 2014 04:10 PM
AAAAHHHHHHHHHHHHHHHHHHH
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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