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: Vulcan Gun Shooting Through FF?

Previous Thread :: Next Thread 
DryBowser21 is not online. DryBowser21
Joined: 05 Oct 2010
Total Posts: 39
12 Jul 2016 12:42 PM
In the new game I am currently working on, I keep on finding that the Vulcan Gun I have put in place can shoot through forcefields, whereas no other gun I have can do this. I don't want spawnkillers, so is there a way I can make the script or something not shoot through forcefields?
Report Abuse
dave2011 is not online. dave2011
Joined: 02 Oct 2010
Total Posts: 10581
12 Jul 2016 12:43 PM
if not char:FindFirstChild("ForceField") then
damagechar()
end


My siggy is a lie
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
12 Jul 2016 12:44 PM
Use TakeDamage rather than directly lowering health.


Report Abuse
seanbenish is not online. seanbenish
Joined: 31 Jul 2009
Total Posts: 429
12 Jul 2016 12:45 PM
humanoid:TakeDamage()


[Insert C++ statement here, b/c roblox doesn't allow it oVo]
Report Abuse
DryBowser21 is not online. DryBowser21
Joined: 05 Oct 2010
Total Posts: 39
12 Jul 2016 02:42 PM
I'm quite rusty with scripts as I haven't dealt with stuff like this in a long time. Would you mind looking through this and inserting the command where it belongs?

ball = script.Parent
damage = 2



function onTouched(hit)
local humanoid = hit.Parent:findFirstChild("Humanoid")
-- make a splat
--for i=1,3 do
-- local s = Instance.new("Part")
-- s.Shape = 1 -- block
-- s.formFactor = 2 -- plate
-- s.Size = Vector3.new(1,.4,1)
-- s.BrickColor = ball.BrickColor
-- local v = Vector3.new(math.random(-1,1), math.random(0,1), math.random(-1,1))
-- s.Velocity = 15 * v--15
-- s.CFrame = CFrame.new(ball.Position + v, v)
--- ball.BrickCleanup:clone().Parent = s
-- s.BrickCleanup.Disabled = false
-- s.Parent = game.Workspace
--
--end


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(8)
ball.Parent = nil
Report Abuse
DryBowser21 is not online. DryBowser21
Joined: 05 Oct 2010
Total Posts: 39
12 Jul 2016 06:08 PM
bumping
Report Abuse
AggressiveCatch is not online. AggressiveCatch
Joined: 17 Jul 2011
Total Posts: 5840
12 Jul 2016 06:09 PM
" humanoid.Health = humanoid.Health - damage"

change to

humanoid:TakeDamage(damage)
Report Abuse
DryBowser21 is not online. DryBowser21
Joined: 05 Oct 2010
Total Posts: 39
12 Jul 2016 06:53 PM
Thank you so much, it worked.
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