How would I check via a explosion if the player is in the blast radius for example if he is it prints("You are in the blast radius). I don’t want it to be that you are exactly in the blast radius so you die. I want to check if the player is near the blast radius!?
Depends on exactly what you want to do. If you just want to check if the player is near a blast radius:
local x = Humanoid.Rootpart.CFrame
local y = Blastpart.CFrame
local distance = (x-y).Magnitude
if distance<minimum then
print("In blast radius..")
end
Sorry, but you have not set an variable that’s minimum also I want to minimum one for when you are not that near and one for when you are quite close.
local Explosion = Instance.new("Explosion", game.Workspace) -- Index your explosion here
Explosion.BlastPressure = 0 -- 0, so it does no damage at all
Explosion.Hit:Connect(function(Part: BasePart, Distance: number)
print(Part.Name.. " was hit from ".. Distance.. " studs away!")
end)
Using the Hit event from the explosion you can see what an explosion. If you set the BlastPressure to 0 it will not do damage. However, you can also use magnituding.
Yeah but that script is for dieng or not?
Have you read what I said? When the Explosion explodes it will not do any damage and will print out what the explosion hit. From there on you can implement your own code.
Oh sorry, now I get it, what I want to do is like making a tinnitus so you don’t hear anything and only hear like the tinnitus
Then use magnituding, which Perilous and I already mentioned.