#why the hell does my script stop working after an exact time

1 messages · Page 1 of 1 (latest)

old karma
#

basically my game has an lap system, when you enter a room you must need to click an button to click to the starting door to complete an lap, once completed you go to the next room, but in some cases the button stops working but has everything but disabled, i checked everything or every line but it doesnt work for an coherent reason.

steady gale
#

Script

old karma
#

imma send u the button script

#

script.Parent.ClickDetector.MouseClick:Connect(function(ee) if script.Parent.Uses.Value > .9 then script.Enabled = false workspace.button:Play() for i,v in game.Players:GetPlayers() do v.Character.Humanoid.Health += 75 end workspace.IsLapLeading.Value = true script.Parent.Uses.Value -= 1 end end)

#

and the door script

#

``script.Parent.ClickDetector.MouseClick:Connect(function(ee)
local quickplr
for i,v in game.Players:GetPlayers() do
quickplr = v
end
if quickplr.Character.Hidden.Value == true then
if workspace.IsLapLeading.Value == true then
game.ServerScriptService.Main.Laps.Value += 1
script.Parent.Parent.Button.Script.Enabled = true
workspace.IsLapLeading.Value = false
workspace.Lock:Play()
if script.Parent.Parent.Button.Uses.Value < 1 then
local random = workspace.Veins:GetChildren()[math.random(1, #workspace.Veins:GetChildren())]
quickplr.Character:PivotTo(random.TP.CFrame)
game.ServerScriptService.Main.ToDo.Value = math.random(1,5)
workspace.Rooms.Value += 1
game.ServerScriptService.Main.Laps.Value = 0
workspace.CurrentDoor.Value = random.Door
end
end
end

end)``

#

@steady gale

steady gale
#

Ur cooked buddy

old karma
#

ok

steady gale
#

Genuinely I can't understand shit

old karma
#

then why the fuck you come here

#

?

steady gale
#

I sometimes help

#

But I haven't slept in 20 hours

steady gale
#

Idk

old karma
#

sterling

steady gale
#

My head hurts for each line of the script

old karma
#

brody i stayed awake for 23 hours like 6 months ago

#

you aint for the weak bro

#

youre weaker

steady gale
#

"script.Parent.Parent.Button.Script"

#

Anyway I'm going to sleep

#

Bye

old karma
#

yall js minimalistic

formal stratus
low escarpBOT
#

studio** You are now Level 3! **studio

formal stratus
#

this is spaghetti code

#

im just trying to help tho dont get mad

old karma
#

how 2

formal stratus
#

put

#

bruh

#

it wont send

#

its three of `

#

then lua im pretty sure

#

that

#

it doesnt let me send

#

``local test = 1000`lua

#

ahh

#

there we go

#

put one ` on each side

inland kiln
#

Do you need a debounce on the first button script

old karma
#

everytime you complete an lap you go to the next room

#

but ig i dont use debounce that much

#

yall can laugh at script.enabled = false wait() script.enabled = true

#

lua gay

low escarpBOT
#

studio** You are now Level 4! **studio

old karma
#

yes

#
    if script.Parent.Uses.Value > .9 then
script.Enabled = false
workspace.button:Play()
for i,v in game.Players:GetPlayers() do
    v.Character.Humanoid.Health += 75
end
    workspace.IsLapLeading.Value = true
    script.Parent.Uses.Value -= 1
    end
end)
and the door script
script.Parent.ClickDetector.MouseClick:Connect(function(ee)
    local quickplr
for i,v in game.Players:GetPlayers() do
    quickplr = v
end 
if quickplr.Character.Hidden.Value == true then
    if workspace.IsLapLeading.Value == true then
        game.ServerScriptService.Main.Laps.Value += 1
script.Parent.Parent.Button.Script.Enabled = true
workspace.IsLapLeading.Value = false
workspace.Lock:Play()
if script.Parent.Parent.Button.Uses.Value < 1 then
local random = workspace.Veins:GetChildren()[math.random(1, #workspace.Veins:GetChildren())]
quickplr.Character:PivotTo(random.TP.CFrame)
game.ServerScriptService.Main.ToDo.Value = math.random(1,5)
workspace.Rooms.Value += 1
game.ServerScriptService.Main.Laps.Value = 0
workspace.CurrentDoor.Value = random.Door
end
end
end

end)```lua
#

dawh