Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

I cant click a button in a gui?

I try to click a button in a gui, The Z index of the button is 4 And the gui display order is 1

local event = game.ReplicatedStorage.Events:WaitForChild("UpgardeEvent", 100)

script.Parent.MouseButton1Click:Connect(function()
	
	local player = script.Parent.Parent.Parent.Parent
	
		print("A")
	
	local stat = script.Parent.Text
	local value = script.Parent.Parent.TextBox.Text
	
	print(player)
	event:FireServer(player, stat, value)
	
end)

Here is how the order goes

Gui |_Frame (Z-Index 3) |_Button That does not work (Z-Index 4) |_Local Script

I Get no errors

2 answers

✓ Accepted answer
local event = game.ReplicatedStorage.Events:WaitForChild("UpgardeEvent")--you dont need the time

script.Parent.MouseButton1Click:Connect(function()

        print("A")

    local stat = script.Parent.Text
    local value = script.Parent.Parent.TextBox.Text

    event:FireServer(stat, value)--roblox automaticaly sends who fired the server so we dont need that

end)

1 comment

0

ok, thank you. but that was't the problem i found a fix but thanks for answering!

Check in your button properties if it's Active, If it's not turn it on.

If this helps you please accept my answer, It helps you and me

1 comment

1

But you didnt help at all. So why would he accept your answer?

This discussion is preserved as it was. New answers, comments, and votes are closed.