i am making a door that opens when leaderstats are a certain number, but i also want the door to remove itself after used, so i changed a small part of the code to be line 10, but now the door doesnt work anymore
local Exp = 1
local db = true
script.Parent.Touched:connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player.leaderstats.Exp.Value >= Exp then
if db then
db = false
script.parent:remove
end
end
end
end)
how do i fix this?

4 comments
did you try script.Parent:Destroy()
Well you don't have correct capitalization
thanks, it works now!
First of all, when you use functions, you have to add parentheses after the function anem