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: Some Trouble, and a bit of nostalgia

Previous Thread :: Next Thread 
sloppylego87 is not online. sloppylego87
Joined: 25 Mar 2011
Total Posts: 326
25 Oct 2015 08:50 PM
Hi. It’s been forever since I’ve been on this branch of the forum. I missed it. I’m also a bit rusty with my programming, so bear with me.

Anyways...

I have programmed this script (LocalScript) so that when the player uses it, it produces an explosion, that ultimately kills them, and any other characters surrounding them.

But the problem is, I want the user to survive, so it is more for the “Surprise” tactic. But, I cannot find a way to simultaneously create a ForceField object that allows the player to survive the explosion.

If you can help, I thank you, but any support would be nice.

Anyways, It’s nice to be back.

Here is the script:

bin = script.Parent

--here it is

function onButton1Down(mouse)

local player = game.Players.LocalPlayer
if player == nil then return end
local EP = Instance.new("Explosion", player.Character.Torso)
local FF = Instance.new("ForceField", player.Character.Torso)
EP.Position = player.Character.Torso.Position
wait()
player.Character.Humanoid.MaxHealth = 100
player.Character.Humanoid.Health = 100
wait(3)
FF = nil
mouse.Icon = "rbxasset://textures\\ArrowCursor.png"
print[[Yeah, it is working.]]

end

function onSelected(mouse)
mouse.Icon = "rbxasset://textures\\ArrowCursor.png"
mouse.Button1Down:connect(function() onButton1Down(mouse) end)
end

bin.Selected:connect(onSelected)
Report Abuse
sloppylego87 is not online. sloppylego87
Joined: 25 Mar 2011
Total Posts: 326
25 Oct 2015 09:07 PM
Bump
Report Abuse
Klink45 is not online. Klink45
Joined: 06 Jun 2011
Total Posts: 26054
25 Oct 2015 09:15 PM
Here is an example:

local f = Instance.new("Forcefield") --New forcefield.
f.Parent = player.Torso --Parents the forcefield.
wait (.1) --Wait just to be sure the ff loads.
local e = Instance.new("Explosion")--New explosion.
e.Parent = game.Workspace --Parent the explosion.
e.Position = player.Torso.Position -- Remember, explosions have a position property that you must manually change.

See if you can figure it out now.

u sicko!
Report Abuse
sloppylego87 is not online. sloppylego87
Joined: 25 Mar 2011
Total Posts: 326
25 Oct 2015 09:17 PM
Bro.

Thank you.

Father is Happy.

But he is still standing behind me.

HELP.
Report Abuse
sloppylego87 is not online. sloppylego87
Joined: 25 Mar 2011
Total Posts: 326
25 Oct 2015 09:18 PM
wait if forcefield is parented inside of torso...


OHMYGOD.

I FIGURED IT OUT.

THANK YOU.
Report Abuse
Locard is not online. Locard
Joined: 13 Apr 2014
Total Posts: 3516
25 Oct 2015 09:18 PM

local p = game.Players.LocalPlayer

function onButton1Down(mouse)
local e = Instance.new('Explosion')
e.DestroyJointRadiusPercent = 0
e.Hit:connect(function(obj)
if obj.Parent:FindFirstChild'Humanoid' and obj.Parent ~= p.Character then
obj.Parent.Humanoid.Health = 0
end
end)
if p.Character:FindFirstChild'Torso' then
e.Parent = p.Character.Torso
end
mouse.Icon = "rbxasset://textures\\ArrowCursor.png"
end
Report Abuse
Klink45 is not online. Klink45
Joined: 06 Jun 2011
Total Posts: 26054
25 Oct 2015 09:18 PM
For starters, is this in a hopperbin?

u sicko!
Report Abuse
sloppylego87 is not online. sloppylego87
Joined: 25 Mar 2011
Total Posts: 326
25 Oct 2015 09:22 PM
Yes. I favor them over “Tools” I grew up with them, and I still use them.
Report Abuse
sloppylego87 is not online. sloppylego87
Joined: 25 Mar 2011
Total Posts: 326
25 Oct 2015 09:23 PM
I fixed it

YAY.
Report Abuse
Klink45 is not online. Klink45
Joined: 06 Jun 2011
Total Posts: 26054
25 Oct 2015 09:24 PM
Ok, for starters read this:
wiki.roblox.com/index.php?title=HopperBin

Note the first paragraph.

u sicko!
Report Abuse
Klink45 is not online. Klink45
Joined: 06 Jun 2011
Total Posts: 26054
25 Oct 2015 09:24 PM
Oh nevermind.
You should still use tools instead.

u sicko!
Report Abuse
sloppylego87 is not online. sloppylego87
Joined: 25 Mar 2011
Total Posts: 326
25 Oct 2015 09:27 PM
eh

don’t matter for me.

I just need to fix this forcefield.

Anyways thanks
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