Hello, i’m making a gore shooter-gore game, i got a gun system that works perfectly. there are a few glitches, but they are just miss-named errors which are really easy to fix, it all works, but i was wondering if theres a way to make it more realistic, heres what i mean:
heres the script:
local ReplicatedStorage = game:GetService('ReplicatedStorage')
local DamageToDoIfTheHitIsAPlayer = 0
local remoteEvent = ReplicatedStorage:FindFirstChild("M1911")
remoteEvent.OnServerEvent:Connect(function(player, gunPos, gunOr, mosPos)
local mouse = player:GetMouse()
game:GetService("ReplicatedStorage")["M1911 Fire"]:Play()
local bullet = Instance.new("Part")
bullet.Position = gunPos
bullet.Orientation = gunOr
bullet.Transparency = 1
bullet.Name = 'Bullet'
bullet.Parent = game.Workspace
bullet.Size = Vector3.new(.25, .25, .25)
bullet.BrickColor = BrickColor.new('Neon orange')
bullet.Shape = Enum.PartType.Block
bullet.CanCollide = false
local speed = 500
bullet.CFrame = CFrame.new(gunPos, mosPos)
bullet.Velocity = bullet.CFrame.lookVector * speed
bullet.Touched:Connect(function(otherPart)
local humanoid = otherPart.Parent:FindFirstChild('Humanoid')
if humanoid and humanoid.Parent.Name ~= player.Name then
local plr = game.Players:GetPlayerFromCharacter(otherPart.Parent)
if humanoid.Health > 0 then
if otherPart.Name == "Left Arm" then
humanoid:TakeDamage(25)
local LeftArmOfThePlayer = otherPart
LeftArmOfThePlayer.Transparency = 1
otherPart.Parent:FindFirstChild("Left Arm"):FindFirstChild("TopArm").Color = LeftArmOfThePlayer.Color
local FakeArm2 = LeftArmOfThePlayer:FindFirstChild("TopArm")
otherPart.Parent:FindFirstChild("Left Arm"):FindFirstChild("TopArm").Transparency = 0
otherPart.Parent:FindFirstChild("Left Arm"):FindFirstChild("TopArm"):FindFirstChild("DamagedArea").Transparency = 0
FakeArm2:FindFirstChild("DamagedArea"):FindFirstChild("WeldToOtherArms"):Destroy()
FakeArm2.Parent = workspace
LeftArmOfThePlayer:FindFirstChild("WeldConstraint"):Destroy()
FakeArm2.CFrame = CFrame.lookAt(FakeArm2.Position,player.Character:FindFirstChild("Head").Position)
FakeArm2:FindFirstChild("DamagedArea").CFrame = CFrame.lookAt(FakeArm2:FindFirstChild("DamagedArea").Position,player.Character:FindFirstChild("Head").Position)
otherPart.Parent:FindFirstChild("Left Arm"):FindFirstChild("TopArm"):FindFirstChild("Part"):FindFirstChild("ParticleEmitter").Enabled = true
wait(2.44)
FakeArm2:FindFirstChild("Part"):FindFirstChild("ParticleEmitter").Lifetime = NumberRange.new(1)
wait(3)
FakeArm2:FindFirstChild("Part"):FindFirstChild("ParticleEmitter").Lifetime = NumberRange.new(0)
otherPart.Parent:FindFirstChild("Left Arm"):FindFirstChild("TopArm"):FindFirstChild("Part"):FindFirstChild("ParticleEmitter").Enabled = false
otherPart.Parent:FindFirstChild("Head"):Destroy()
elseif otherPart.Name == "Right Arm" then
humanoid:TakeDamage(25)
local LeftArmOfThePlayer = otherPart
LeftArmOfThePlayer.Transparency = 1
otherPart.Parent:FindFirstChild("Right Arm"):FindFirstChild("TopArm").Color = LeftArmOfThePlayer.Color
local FakeArm = LeftArmOfThePlayer:FindFirstChild("TopArm")
otherPart.Parent:FindFirstChild("Right Arm"):FindFirstChild("TopArm").Transparency = 0
otherPart.Parent:FindFirstChild("Right Arm"):FindFirstChild("TopArm"):FindFirstChild("DamagedArea").Transparency = 0
FakeArm:FindFirstChild("DamagedArea"):FindFirstChild("WeldToOtherArms"):Destroy()
FakeArm.Parent = workspace
FakeArm:FindFirstChild("WeldConstraint"):Destroy()
FakeArm.CFrame = CFrame.lookAt(FakeArm.Position,player.Character:FindFirstChild("Head").Position)
FakeArm:FindFirstChild("DamagedArea").CFrame = CFrame.lookAt(FakeArm:FindFirstChild("DamagedArea").Position,player.Character:FindFirstChild("Head").Position)
otherPart.Parent:FindFirstChild("Left Arm"):FindFirstChild("TopArm"):FindFirstChild("Part"):FindFirstChild("ParticleEmitter").Enabled = true
wait(2.44)
FakeArm:FindFirstChild("Part"):FindFirstChild("ParticleEmitter").Lifetime = NumberRange.new(1)
wait(3)
FakeArm:FindFirstChild("Part"):FindFirstChild("ParticleEmitter").Lifetime = NumberRange.new(0)
otherPart.Parent:FindFirstChild("Left Arm"):FindFirstChild("TopArm"):FindFirstChild("Part"):FindFirstChild("ParticleEmitter").Enabled = false
otherPart.Parent:FindFirstChild("Head"):Destroy()
elseif otherPart.Name ~= "Head" then
humanoid:TakeDamage(30)
local particleEmitter = ReplicatedStorage.Blood:Clone()
particleEmitter.Parent = otherPart
bullet:Destroy()
particleEmitter:Emit()
wait(1)
particleEmitter:Destroy()
elseif otherPart.Name == "Head" then
humanoid:TakeDamage(100)
local Head1 = otherPart.Parent:FindFirstChild("Head")
Head1.Transparency = 1
Head1:FindFirstChild("face"):Destroy()
local head = otherPart.Parent:FindFirstChild("Head"):FindFirstChild("FakeHead")
otherPart.Parent:FindFirstChild("Head"):FindFirstChild("FakeHead").Transparency = 0
local particleEmitter = ReplicatedStorage.Blood:Clone()
otherPart.Parent:FindFirstChild("Head"):FindFirstChild("FakeHead"):FindFirstChild("DamagedArea").Transparency = 0
otherPart.Parent:FindFirstChild("Head"):FindFirstChild("FakeHead").Color = otherPart.Parent:FindFirstChild("Head").Color
head:FindFirstChild("Part"):FindFirstChild("ParticleEmitter").Enabled = true
head:FindFirstChild("WeldToOtherArms"):Destroy()
Head1:FindFirstChild("WeldConstraint1"):Destroy()
head.Parent = workspace
particleEmitter.Parent = otherPart
head.CFrame = Head1
particleEmitter:Emit()
wait(2.44)
head:FindFirstChild("Part"):FindFirstChild("ParticleEmitter").Lifetime = NumberRange.new(1)
wait(3)
head:FindFirstChild("Part"):FindFirstChild("ParticleEmitter").Lifetime = NumberRange.new(0)
end
end
end
end)
end)
I’m not trying to make a gore model for literally each spot on the arm, im trying to achieve this using a script, please help!
also, visual help would be the best!