Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

My Time Bomb is not working as intended Help?

Asked by
iLordy 27
4 years ago

I am using the pre made time bomb roblox has to offer us, I am modifying it so the owner is not able to kill himself. However it is not working as intended, when I test this out yes the owner doesn't have its limbs blown out or is killed but neither is anybody else. How could I make it where only the owner is safe from the explosion?


local Tool = script.Parent local vCharacter = Tool.Parent local vPlayer = game.Players:playerFromCharacter(vCharacter) function blowUp() local sound = Instance.new("Sound") sound.SoundId = "rbxasset://sounds\\Rocket shot.wav" sound.Parent = script.Parent sound.Volume = 1 sound:play() explosion = Instance.new("Explosion") explosion.BlastRadius = 12 explosion.BlastPressure = 1000000 explosion.DestroyJointRadiusPercent = 0 explosion.Hit:Connect(function(part, distance) local hum = part.Parent:FindFirstChild("Humanoid") if hum ~= vPlayer.Humanoid then hum:TakeDamage(100) explosion.DestroyJointRadiusPercent = .5 end end)
0
OMG.... NIMI5Q -2 — 4y
0
what is this bad code DeceptiveCaster 3761 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

Look on line 2, you are defining that the owner is the tools parent, which is the local player. But since you are not adding any arguments it assumes that everybody has a player, replace it by doing an if else statement checking the player id.

Ad

Answer this question