Hello! I know that this is another post I have made almost right after my last one, but I just need a lot of help.
So in the game, you cannot continue with the steps of selling your NFT when you haven’t drawn anything. When you click the drawing frame, a bool gets activated and the next button lights up. When you erase, it resets the next button and the bool is deactivated. When you click on the frame, if the bool is active, it won’t do any of the code to prevent lag and stuff. When you close and re-open the in-game phone, everything resets. It takes you back to the starting screen, deactivates buttons, clears previously filled fields, and also deactivates the bool. But when you click on the frame, the button doesn’t light up. You have to click erase and then click on the frame again to light the button up. I don’t know why this happens, but I’ll link my code.
-- this is the code that resets stuff, different script than the one with the button. "Done" is a boolvalue, not a variable
script.Parent.MouseButton1Click:Connect(function()
if phone.Visible == false and debounce == false then
debounce = true
phone.Visible = true
phone.Draw.Visible = true
phone.DrawScreen.Visible = true
phone.NameScreen.Visible = false
phone.SoldScreen.Visible = false
phone.NameScreen.Naming.Text = ""
phone.Draw.Drawing.Disabled = false
phone.Main.Done.Value = false
phone.DrawScreen.Next.LocalScript.Disabled = true
phone.DrawScreen.Next.Roundify.ImageColor3 = othercolor
phone.SoldScreen.NFTLabel.Text = "nfts"
clearframes(phone.Draw)
script.Parent.Text = "<"
phone:TweenPosition(UDim2.new(0.5, -162, 0.5, -264), "Out", "Quint", 1, true)
wait(1)
debounce = false
elseif phone.Visible == true and debounce == false then
debounce = true
script.Parent.Text = ">"
phone:TweenPosition(UDim2.new(-0.5, -162, 0.5, -264), "In", "Quint", 1, true)
wait(1)
phone.Visible = false
debounce = false
end
end)
By the way, I should probably say that both of these scripts work fine. No output errors or anything, which stops the scripts from running.
-- this is the script that manages the buttons. It has the Done boolvalue in it.
frame.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
if done == false then
drawscreen.Next.Roundify.ImageColor3 = thecolor
drawscreen.Next.LocalScript.Disabled = false
done = true
end
end
end)
drawscreen.Erase.MouseButton1Click:Connect(function()
clearframes(frame)
drawscreen.Next.Roundify.ImageColor3 = othercolor
drawscreen.Next.LocalScript.Disabled = true
done = false
end)
As always, any help would be appreciated!