You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? A system that can be used so that once an object hits you ex a part of a broken window with enuf speed, You will die
-
What is the issue? It can be exploited by jumping into the roof, Then youll die and you cannon jump on slanted surfaces
local plr = game.Players:GetPlayerFromCharacter(script.Parent)
local character = plr.Character
print("WORKING")
for _,v in pairs(character:GetChildren()) do
if v:IsA("Part") then
v.Touched:Connect(function(t)
--local kinetic = t.Mass/16 * ((v.Velocity-t.Velocity).Magnitude/4)^2
--print(((v.Velocity-t.Velocity).Magnitude/4)^2)
--print(t.Mass/16 * ((v.Velocity-t.Velocity).Magnitude/4)^2)
print(v.Mass/16 * ((v.Velocity-t.Velocity).Magnitude/4)^2)
if (t.Mass/16 * ((v.Velocity-t.Velocity).Magnitude/4)^2) >= 196 and not (t.Anchored) then
character:BreakJoints()
elseif (v.Mass/16 * ((v.Velocity-t.Velocity).Magnitude/4)^2) >= 75 then
for _,v in pairs(character:GetChildren()) do
character:BreakJoints()
end
end
end)
end
end