Please help me with my code. ty

no error no error no error no error no error no error no error no error

image
this is when u click the gui

image

image
and this is the activation of the jumpscare

Could you add breakpoints at the start of the button when you PromptProductPurchase, one in the ProcessReceipt method at the start, and one in the Jumpscare OnClientEvent part. I want to see where the code gets to.


heres the code for the gui so u can buy the dev producrt

1 Like

image
then this is the code for the jumpscare to work

btw this jumpscare thingy are all from my other game im just trying to tranfer it to my new game but idk how

I suggest using math.random() instead of random.new().

Both work fine. Random is just a lot more flexible with what it can do.

I believe using math.random goes from a set randomseed (meaning the same random ‘pattern’ so to speak), a blank math.random iwith no parameter always uses the default ‘pattern’ seed, hence the random generation pattern will be the same, try it, generate 10 random numners using math.random, leave/stop the game and retry it, I’m sure the same 10 numbers will show up.

Random.new() on the other hand uses a completely random sees every time it’s invoked.

This was the output for the first test:
image_2023-07-04_113007253

This was the output for the second test:
image

The numbers are different.

1 Like

Ah nice, I remmeber when I tested it the numbers it generated were the same, but thinking about it, I also used randomseed, which might generate a default seed? Maybe that’s why.