Remote is not firing when button is pressed

I’m trying to make a remote fire when a specific button is pressed, it works for the first button, but the rest of them it’s not working correctly all of a sudden.

local kc = script.Parent.kcButton
local sp = script.Parent.spButton
local theworld = script.Parent.ZaWarudoButton
local void = script.Parent.VoidButton
local standcheck = script.Parent.standCheck
local kcADD = game.ReplicatedStorage.addstandKC
local spADD = game.ReplicatedStorage.addstandSP
local twADD = game.ReplicatedStorage.addstandTW
local voidADD = game.ReplicatedStorage.addstandVOID
local humanoid = game:GetService("Players").LocalPlayer.Character:WaitForChild("Humanoid")



function kcClicked()
	kcADD:FireServer()
	humanoid.Health = 0
	standcheck.Visible = true
	script.Disabled = true
end

function spClicked()
	spADD:FireServer()
	humanoid.Health = 0
	standcheck.Visible = true
	script.Disabled = true
end

function TWClicked()
	twADD:FireServer()
	humanoid.Health = 0
	script.Disabled = true
end

function VOIDClicked()
	voidADD:FireServer()
	humanoid.Health = 0
	standcheck.Visible = true
	script.Disabled = true
end







kc.MouseButton1Click:Connect(kcClicked)
sp.MouseButton1Click:Connect(spClicked)
theworld.MouseButton1Click:Connect(TWClicked)
void.MouseButton1Click:Connect(VOIDClicked)

The “kcClicked” works perfectly fine, but the rest of them don’t, and there is nothing in the output.
Here is what happens when the kc button is pressed:
https://gyazo.com/8699be9806e9f3cc6dbf13653b913c57

But when the SP button is pressed it does nothing, I fired the remote to check if it works and it works just fine:
https://gyazo.com/0dd10a64373ef6ef092ece4b30af6a75

I can’t find the solution to why the button isn’t firing the remote.

The only things I see that might cause problems is
A. You disabling the script or
B. You’re not accounting for the screen UI’s “ResetOnSpawn” property and the variables you’re using are being set to nil (or something of the sorts), and thus the events aren’t firing.

Try using a bunch of prints to figure out where the issue is at, and if you can’t solve it then, come back with more information.

1 Like

I believe it’s because you’re disabling the script, and it acts a global for all your functions. Have you tried not clicking kcClicked and trying the other buttons first?

1 Like

The script is disabled when the button is pressed, however, it is enabled when the “remove stand” button is pressed, and it works just fine with the “KC” button. I did try to click SP button first but no signs of anything, not even in the output.

Here you can see when the button is pressed for KC it enables a script in the starter pack:
https://gyazo.com/c4e9f7627551c12a8e3d1885caf5b88c

But when SP is clicked it changes nothing:
https://gyazo.com/7b2eea43f85d9689dc4c5aa829d01d5b

The code that enables them is in the ServerScriptService:

local kcAdd = game.ReplicatedStorage.addstandKC

kcAdd.OnServerEvent:Connect(function(Player)
	game.StarterPack.StandStuff.kcHandler.Disabled = false
	game.ServerScriptService.StandSpawning.kingCrimsonSpawn.Disabled = false
	print("KC is now the players stand.")
end)

local SPAdd = game.ReplicatedStorage.addstandSP

SPAdd.OnServerEvent:Connect(function(Player)
	game.StarterPack.StandStuff.spHandler.Disabled = false
	game.ServerScriptService.StandSpawning.StarPlatinumSpawn.Disabled = false
	print("Star platinum is now the active stand")
end)

It may be a zindex issue, try looking into your Gui properties. If you add a print to when you click the SP button, does it print?

I tried adding a print, and it didn’t print anything.

Found the fix:
I’m surprised I didn’t catch this earlier, I gave the wrong names to certain buttons, I just renamed the buttons and it works just fine.