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 » Club Houses » Clans & Guilds
Home Search
 

Re: How to make guns to where you can't shoot...

Previous Thread :: Next Thread 
Vhakar is not online. Vhakar
Joined: 23 Jan 2013
Total Posts: 6203
16 May 2016 10:49 PM
...after you die.

I lost the other thread.
Report Abuse
ImperialArmada is not online. ImperialArmada
Joined: 31 Aug 2015
Total Posts: 2461
16 May 2016 10:49 PM
dont use free model guns
Report Abuse
RyferionPrime is online. RyferionPrime
Joined: 01 Jul 2012
Total Posts: 3741
16 May 2016 10:52 PM
"dont use free model guns"
Tbh, kinda true, 90% of fm guns have afterdeath killing.
The ones I use/used fell thru the map after you died, so shooting or not you were dead.
Report Abuse
Vhakar is not online. Vhakar
Joined: 23 Jan 2013
Total Posts: 6203
16 May 2016 11:30 PM
Bump
Report Abuse
Vhakar is not online. Vhakar
Joined: 23 Jan 2013
Total Posts: 6203
17 May 2016 05:31 PM
Bump
Report Abuse
Theta0 is not online. Theta0
Joined: 09 Feb 2011
Total Posts: 40750
17 May 2016 07:29 PM
add this to the firing function



if character.Humanoid.Health <= .001 then
dont fire
end
Report Abuse
xEnforcer is not online. xEnforcer
Joined: 03 Jun 2011
Total Posts: 1077
17 May 2016 07:33 PM
assuming this is in a localscript,

local p = game.Players.LocalPlayer

if p.Character.Humanoid.Health <= 0 then

script.Parent:Destroy() -- or remove??

end
Report Abuse
xEnforcer is not online. xEnforcer
Joined: 03 Jun 2011
Total Posts: 1077
17 May 2016 07:34 PM
you'd also need a loop or function, as that will run once and only once

while loops r easy enough to make, but too many of them can lag
Report Abuse
ezaiahs is not online. ezaiahs
Joined: 28 Jun 2011
Total Posts: 18613
17 May 2016 07:42 PM
while true do
wait(1)
end




Report Abuse
Theta0 is not online. Theta0
Joined: 09 Feb 2011
Total Posts: 40750
17 May 2016 08:57 PM
dont listen to xEnforcer

add these lines to ur script


local plr = game.Players.LocalPlayer
repeat wait() until plr.Character
local humanoid = plr.Character:WaitForChild("Humanoid")

humanoid.Changed:connect(function()
if humanoid.Health <= .001 then
script.Parent:Destroy()
end
end)

Report Abuse
kingkendrick141 is not online. kingkendrick141
Joined: 16 Sep 2009
Total Posts: 12172
17 May 2016 08:59 PM
if health less than or equal to zero then canfire=false
im too lazy to put that into lua but yeah that's the jist

it's a failsafe that's easy to put in you just set your gun up so that they create a variable that acts as a failsafe, and when the variable is false the gun cannot fire. Then you make the variable true when the player is alive and false when the player has 0(or less) health
Report Abuse
Isosta is not online. Isosta
Joined: 10 May 2015
Total Posts: 14729
17 May 2016 09:00 PM
@theta,

just do <= 0


the power of the meme ( ͡° ͜ʖ ͡°)
Report Abuse
Isosta is not online. Isosta
Joined: 10 May 2015
Total Posts: 14729
17 May 2016 09:01 PM
the technical term is a debounce


the power of the meme ( ͡° ͜ʖ ͡°)
Report Abuse
kingkendrick141 is not online. kingkendrick141
Joined: 16 Sep 2009
Total Posts: 12172
17 May 2016 09:01 PM
@theta

Why not <=0? Removes any potential weirdness where the health is less than .001 but the player is still alive and it also makes for a more exact, quicker check.
Report Abuse
xEnforcer is not online. xEnforcer
Joined: 03 Jun 2011
Total Posts: 1077
17 May 2016 09:04 PM
'dont listen to xenforcer'

my example and what I stated after it basically did what you displayed lol

>gets the player's humanoid
>checks (within a function) the players health, and if it's below 0, remove it

and like the others said, it'd be much more logical to just do <= 0 rather than .001

Report Abuse
zdude3000 is not online. zdude3000
Joined: 05 May 2009
Total Posts: 10834
17 May 2016 09:08 PM
TBH

.001 or 0 seems like a minute point, so long as you dont have awkward values put in for the damage of your guns (i.e. sniper doing 99.999 damage)
Report Abuse
Isosta is not online. Isosta
Joined: 10 May 2015
Total Posts: 14729
17 May 2016 09:09 PM
@zdude,

roblox healing heals using decimals.

>Damage
>heal
>more damage

.000001 health


the power of the meme ( ͡° ͜ʖ ͡°)
Report Abuse
zdude3000 is not online. zdude3000
Joined: 05 May 2009
Total Posts: 10834
17 May 2016 09:11 PM
really? thats dumb

but they do them

Report Abuse
Isosta is not online. Isosta
Joined: 10 May 2015
Total Posts: 14729
17 May 2016 09:12 PM
And even if it is a very tiny chance,
why would you not protect against it? i mean, why not? especially since it takes less characters to type anyways


the power of the meme ( ͡° ͜ʖ ͡°)
Report Abuse
kingkendrick141 is not online. kingkendrick141
Joined: 16 Sep 2009
Total Posts: 12172
17 May 2016 09:13 PM
@zdude
ROBLOX healing works on a decimal/percentage basis.

Because of that if you don't place it at exactly 0 you can disable a player's gun without them actually being dead. If you set it to exactly 0, they're guaranteed to be dead when the gun is disabled.
Report Abuse
Vhakar is not online. Vhakar
Joined: 23 Jan 2013
Total Posts: 6203
17 May 2016 09:23 PM
Thanks, worked @theta


Report Abuse
Isosta is not online. Isosta
Joined: 10 May 2015
Total Posts: 14729
17 May 2016 09:24 PM
please tell me you changed .001 to 0


the power of the meme ( ͡° ͜ʖ ͡°)
Report Abuse
Vhakar is not online. Vhakar
Joined: 23 Jan 2013
Total Posts: 6203
17 May 2016 09:31 PM
What's wrong with having it .001?


Report Abuse
Blokov is not online. Blokov
Joined: 16 Dec 2015
Total Posts: 1512
17 May 2016 09:35 PM
Check changes in the Humanoid of the local player.

I think this works on FilteringEnabled and not:

game:GetService("Players").LocalPlayer.Character.Humanoid.Changed:connect(function(P)
if game:GetService("Players").LocalPlayer.Character.Humanoid.Health <= 0 then script:Destroy() end
end)


Report Abuse
kingkendrick141 is not online. kingkendrick141
Joined: 16 Sep 2009
Total Posts: 12172
17 May 2016 10:00 PM
@Vhak
Like we said, 0 is a simpler number and it vastly reduces the potential for glitches and bugs. ROBLOX health runs on a decimal basis so there's a (very small) chance that your guns will disable when the player hasn't fully died yet. Better cover for it than let it potentially ruin someone's experience.
Another big benefit is that since 0 is simpler than 0.001, running a check each time is a lot more efficient and can lead to less net lag.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Club Houses » Clans & Guilds
   
 
   
  • 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