Yeah i do!
The same NumberValue in planks but with value being 100
Try hitting it again. Anything in output?
As i said before, when was telling that planks and glass do not break and output is empty, yeah, it still empty.
I rewrote it, two of my planks broke, make two sounds named Hit and Shatter inside the planks and IT should work. Otherwise something is wrong with your fe gun kit.
function Shatttttttterrrrrrrrrrrrrrrrrrr(Part:Part?, P, D)
if Part.Health.Value <= 0 and not Part:FindFirstChild("B") then
local B = Instance.new("Frame")
B.Name = "B"
B.Parent = Part
Part.Shatter:Play()
task.delay(2,function()
Part:Destroy()
--Hit.Transparency = 0 -- or if you awnna make it respawn : )
--Hit.Health.Value = 100 -- delete the comments if you wanna do the second option.
end)
GlassShattering:Shatter(Part, P, D + Vector3.new(math.random(-25, 25), math.random(-25, 25), math.random(-25, 25)))
end
end
ShatterGlass.OnServerEvent:Connect(function(Player, Hit, Pos, Dir)
if Hit then
if Hit.Name == "_glass" then --It can be _plank but that would require editing every gun client script.
if Hit.Material == Enum.Material.WoodPlanks then -- ?
if Hit.Health.Value > 0 and Hit.Transparency ~= 1 then -- YAY
Hit.Health.Value -= 15 -- damage. -- base health is 100. : )
Hit.Hit:Play()
Shatttttttterrrrrrrrrrrrrrrrrrr(Hit, Pos, Dir)
end
end
end
end
end)
Wait can I see your SimulateBulletScript script? Also i edited snippet above so you might have to use that.
I just used that script, cause on last i noticed material.woodplanks, while i must do material.wood.
Im so sorry for being that dumb and wasting time…
It’s fine, if it worked you can mark my reply as a solution so the thread closes.
Ill just now add 2nd material that can be destroyed, actual glass. I already understood how to do it so, thanks for your help!
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.