local door = game.Workspace.Door1
local surfacegui = door.SurfaceGui.TextLabel
local plr = game.Players.LocalPlayer
door.Touched:Connect(function(touch)
if touch.Parent:FindFirstChild("Humanoid") then
if plr.leaderstats.Throws.Value < 99 then
print("Player Does Not Have Enough")
door.Transparency = 0.5
door.CanCollide = true
surfacegui.Visible = true
else
if plr.leaderstats.Throws.Value >= 99 and not plr:FindFirstChild("doorOpened") then
local d = Instance.new("IntValue")--doesn't really matter if its a intvalue or not
d.Name = "doorOpened" --names it so the script knows the player has already passed thru
d.Parent = plr
plr.leaderstats.Throws.Value = plr.leaderstats.Throws.Value -100
plr.doors.DoorsOpened.Value = plr.doors.DoorsOpened.Value +1
if plr.doors.DoorsOpened.Value == 1 then
door.Transparency = 1
door.CanCollide = false
surfacegui.Visible = false
end
end
end
end
end)
If you touch the door BEFORE you have 100 throws it wont let you go through. Which is normal. But if you get enough if you already touched it before you had enough it steals your throws and wont let you go through?
