So, I’m working on the same project that I talked about some days ago. [ Link: [Solved] How to detect if a player took damage ].
Okay, I was going well with the project and bla bla blah.
I was working on that again these days, and I found something that’s kinda annoying for a bloody fighting game. Here is the issue [ Blood warning. ]:
robloxapp-20210405-0232444.wmv
Has you can see, the chance doens’t change until you die.
I already tried fixing that, but without sucess…
here is the code:
local BaseballBat = script.Parent
local Animations = BaseballBat.Animations
local BaseballBatIdle = Animations.BaseballBatIdle
local BaseballBatSwing01 = Animations.BaseballBatSwing01
local BaseballBatSwing02 = Animations.BaseballBatSwing02
local BaseballBatSwing = BaseballBat.Handle.BaseballBatSwing
local Hit01 = BaseballBat.Handle.Hit01
local Hit02 = BaseballBat.Handle.Hit02
local Hit03 = BaseballBat.Handle.Hit03
local Hit04 = BaseballBat.Handle.Hit04
local Critical01 = BaseballBat.Handle.Critical01
local Critical02 = BaseballBat.Handle.Critical02
local Critical03 = BaseballBat.Handle.Critical03
local Critical04 = BaseballBat.Handle.Critical04
local Limbs = game:GetService('ReplicatedStorage').Limbs
local HeadLimbs = Limbs.HeadLimbs
local TorsoLimbs = Limbs.TorsoLimbs
local MathRandom = math.randomseed(0, 1)
Debounce = false
local Track01
BaseballBat.Equipped:Connect(function()
Track01 = BaseballBat.Parent.Humanoid:LoadAnimation(BaseballBatIdle)
Track01.Looped = true
Track01:Play()
end)
local Track02
local Track03
BaseballBat.Activated:Connect(function()
if Debounce == false then
Debounce = true
Track02 = BaseballBat.Parent.Humanoid:LoadAnimation(BaseballBatSwing01)
Track02.Looped = false
Track03 = BaseballBat.Parent.Humanoid:LoadAnimation(BaseballBatSwing02)
Track03.Looped = false
if MathRandom == 0 then
Track02:Play()
Track03:Stop()
else
Track03:Play()
Track02:Stop()
end
BaseballBatSwing:Play()
BaseballBat.BaseballBat.Touched:Connect(function(Hit)
if Hit.Parent:FindFirstChild('Humanoid') then
if Debounce == true then
if MathRandom == 0 then
Hit01:Play()
Hit.Parent.Humanoid:TakeDamage(22)
wait(0.921321512312)
Debounce = false
else
if Hit:FindFirstChild('BloodParticle01') then
Critical01:Play()
Hit.Parent.Humanoid:TakeDamage(25)
Hit.BloodParticle01.Enabled = true
Hit:Destroy()
wait(0.921321512312)
Debounce = false
end
Hit:Destroy()
Debounce = false
end
end
end
end)
wait(0.921321512312)
Debounce = false
end
end)
BaseballBat.Unequipped:Connect(function()
if Track01 then
Track01:Stop()
end
end)
The problem is with the math.randomseed().
- Tsu Washington / SovietFurryBruh.