Help debugging my code

I want to make it so when I click a button, it buys an item from my in-game shop, but for some reason its not working? I tried debugging by using print and it didn’t print anything even though I am pressing the button.

2 Likes

Are you sure you connected the function?

1 Like

Yeah to me it seems like your script isn’t scripting properly

2 Likes

Yes, I connected the function using :Wait
After it is done waiting, it sends the remote event and then connects it to Wait again

1 Like

Have you tried using a debounce?

Yeah, I set the debounce for 1 second and it didn’t do anything still :crying_cat_face:

1 Like

Maybe the remote isn’t being received sonehow? Could be the issue.

Maybe, my remote event code is this (i will translate it to english idk if you guys can read it)

local PLR = Money.OnClientEvent:Wait()
print("he bought the item")
if PLR:GetAttribute("Money") > 500 then
    PLR:SetAttribute("current item", "Big shooty gun")
end