Script not working

Anybody know why this script isn’t working?

serverscript

local clone = game.ReplicatedStorage.GUIS.r:Clone()
		clone.Parent = player.PlayerGui
		clone.Frame.IsActive.Value = true

localscript

script.Parent.Parent.IsActive.Changed:Connect(function()
	while script.Parent.Value.Value ~= 0 do 
		wait(1)
		script.Parent.Value.Value = script.Parent.Value.Value - 1
		script.Parent.Text = script.Parent.Value.Value.." SECONDS LEFT"
		if script.Parent.Value.Value == 0 then
			game.ReplicatedStorage.m:FireServer(360, "R")
			script.Parent.Parent.Parent:Destroy()
			script:Destroy()
		end	
	end
end)

Try this and see what Outputs?

script.Parent.Parent.IsActive.Changed:Connect(function()
    print("Change detected")
	while script.Parent.Value.Value ~= 0 do 
		wait(1)
        print("Loop running")
		script.Parent.Value.Value = script.Parent.Value.Value - 1
		script.Parent.Text = script.Parent.Value.Value.." SECONDS LEFT"
		if script.Parent.Value.Value == 0 then
            print("Found a result")
			game.ReplicatedStorage.m:FireServer(360, "R")
			script.Parent.Parent.Parent:Destroy()
			script:Destroy()
		end	
	end
end)

nothing was in output about this

Try referencing the IsActive.Value with a wait?

local clone = game.ReplicatedStorage.GUIS.r:Clone()
clone.Parent = player.PlayerGui
wait(2)
clone.Frame.IsActive.Value = true

Bruh I thought I replied to the wrong person

Still nothing is outputted… This is weird

Where is the script located? also is it Disabled lol

no, it’s not disabled.

localscript is in the GUI and this script is inside a clickdetector script, (after you click the UI opens after something else happens)

local scripts will only run if it is a descendant of

  • StarterGui
  • PlayerScripts
  • ReplicatedFirst
  • Backpack
  • Also the character
2 Likes