I have recently started coding, and following the courses on Studio+. The problem with this is that there is no course on making a obby. I have seen other threads about this but they require higher coding skills. Any scripts that could include the "****if****" statement? Cheers!
yall are making this hard just use this
inside the killpart
script.Parent.Touched:Connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") then hit.Parent.Humanoid:TakeDamage(100) -- Amount of damage end end)
Use Humanoid: TakeDamage
"script" inside the Killbrick
script.Parent.Touched:Connect(function(p) p.Parent.Humanoid:TakeDamage(100) end)
There Test it Out, i haven't tested it yet if there's problem just comment again
EDITED Put this in a script inside a part:
local p = script.Parent local d = {} p.Touched:Connect(function(hit) local c = hit.Parent local h = c:WaitForChild("Humanoid") local p = game.Players:GetPlayerFromCharacter(c) if p and h and not d[c] then d[c] = true h:TakeDamage(100) -- set to as much as you want, 100 will kill the player. wait(2) d[c] = nil end end)
If that helped please accept this answer.
All the best,
PrismaticFruits