Function firing even though gui button not pressed

Im tryna make a npc chat thing. but the function if firing without button being pressed Someone pls helpp
I also tried using mouse button1click but that didnt change anything

local Chat = script.Parent.Text
local B1 = script.Parent.Button1
local B2 = script.Parent.Button2

script.Parent.Text.Text = "I got a simple job for you. earn a bit of cash. You want in?"

B2.Text = "no"
B1.Text = "yes"

if B2.Activated then                                  ---- issue here
	Chat.Text = "bro go away then"
	wait(3)
	script.Parent.GuiDestroyer:FireServer()
end

Also thought i might throw a second issue in here but these two dummies loose their skin tone when the game runs but my other dummy keeps his


image

1 Like

You don’t activate a button like that.
You do it like this

local Chat = script.Parent.Text
local B1 = script.Parent.Button1
local B2 = script.Parent.Button2
Chat.Text = "I got a simple job for you. earn a bit of cash. You want in?"

B2.Text = "no"
B1.Text = "yes"


B2.Activated:Connect(function()
	Chat.Text = "bro go away then"
	wait(3)
	script.Parent.GuiDestroyer:FireServer()
end)

also no need for script.Parent.Text.Text when u already have defined local Chat = script.Parent.Text

I did a quick test on my own. Should work now.

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.