bassicly the title
I believe you’d have to use Raycast
to check if a player has walked in the area under the spike
You could have a part on the floor under the spikes to detect when a player is in it
That could work too, he’d just need to make sure that part fits exactly the spike bottom’s shape.
local trapPart = script.Parent
local function onPartTouch(otherPart)
local partParent = otherPart.Parent
local humanoid = partParent:FindFirstChildWhichIsA(“Humanoid”)
if ( humanoid ) then
– add spike fall script here
“trapPart” is the Activator.
do i put the trapPart parented to the spike or the spike parented to the trapPart
TrapPart to the spike probably.
Put a part with a script that will make the spike unanchored on touch and it will fall
it doesnt seam to work
Have two parts, your spike part, and an activator part(preferably a normal square part). If your activator part gets touched you lerp the spike down to the activator parts position and then do whatever code you want to do after spike falls
i already have a code that makes it fall and respawn but it doesnt fall when you touch the activator
SInce you said you have the spike fall and the respawn, I will just give you the activator part.
local activator = script.Parent
activator.Touched:Connect(function(hit:BasePart)
local char = hit:FindFirstAncestorWhichIsA'Model'
if char and char:FindFirstChild'Humanoid' then
-- Spike fall
end
end)
I usually use Region3 to detect a player under an object (so I don’t have to rely on .Touched) and for pairs everything inside of the Region3.
You could also use GetTouchingParts instead of using Region3. But I’d prefer Region3
Watch this video: How to Make a Spiked Wall Trap (Using TweenService) - Roblox Studio Tutorial - YouTube
This video has all the information you need to be able to make a spike fall when a player goes under it.
It will teach you how to move a spike when a player touches a part using the TweenService. Then, the spike will go back to its original position and wait for the next player to touch the part.
is CanTouch enabled?
char limitttttttttttttttttttt
yes