Im trying to make a glass panel shatter after many people jump on it? how would i achieve this?
Hi zilly,
I suggest you check the Humanoid:GetState() in a :Touched() function. If the State is Enum.HumanoidStateType.Landed then you can do whatever you want tot do with the part.
You would get something like this:
script.Parent.Touched:Connect(function(hit)
if hit and hit.Parent and hit.Parent:FindFirstChild("Humanoid") then
local hum : Humanoid = hit.Parent:FindFirstChild("Humanoid")
if hum:GetState() == Enum.HumanoidStateType.Landed then
script.Parent:Destroy()
end
end
end)
Tell me if this worked.
1 Like
Thanks this helps a lot but is there a way i can know how high they fell from before hitting the part?
check their velocity, (might need to have a fake part above it that does the velocity check and stores it for the glass part) and in the glass part have a parameter that stores total damage and damage tacking