I have 2 questions but lets talk about that at the end. My killbrick spinner does spin but doesn't deal damage. It is a spinner with some CylindricalConstraint thingy that can move the player. The killbrick in the spinner is named "Instant KillBrick" and I can't find anything wrong with it.
So here is the script I guess:
local Debounce = false for _,v in pairs(workspace:GetDescendants()) do if v:IsA("BasePart") and v.Name == "Instant KillBrick" then v.Touched:Connect(function(hit) if Debounce == false then Debounce = true local Player = hit.Parent:FindFirstChild("Humanoid") if Player then Player:BreakJoint() Debounce = false end end end) end end
You have to set Debound to true after detecting it is Player! Read your logic again. what happens if it touches non-humanoid ? it sets Debounce to true and that wont be changed again.
instead of all this create a function with an event called "Touched" so whenever its touched its gonna do something
local instantKillBrick = game.Workspace["Instant KillBrick"] local divideBy = 3 instantKillBrick.Touched:Connect(function(hit) local player = hit.Parent:FindFirstChild("Humanoid") if player then player.Health -= divideBy end end)
Making Brick Detector
Instead of using that method, try using mine!
Its simple! Follow This Tutorial:
1. Make A Kill Brick
You can use brick and color it red and set material to Neon!
2. Make A Folder
Make a folder in workspace, then name it yourself! Then put your Kill Brick inside of it.
3. Make A Kill Script
You can copy my script:
local KillBrick = workspace:FindFirstChild("Folder Name"):GetChildren() --Change Folder Name To Your Folder Name! local Debounce = false local Damage = 10 --Total of the damage! while wait() do for i = 1, #KillBrick do KillBrick[i].Touched:Connect(function(Hit) if Hit.Parent:FindFirstChild("Humanoid")and Debounce == false then Debounce = true Hit.Parent.Humanoid.Health -= Damage wait(0.5) --Time of Working Again! Debounce = false end end) end end
After That, Put it on ServerScriptService or Workspace!
Thats all you need to do!
Comment Down Bellow If You Find Any Problem!
Thank's for Reading!