[Help] My array won't change when looping pages

Post all technical issues and questions here. We'll gladly help you wherever we can.
Post Reply
Epton
Explorer At Heart
Explorer At Heart
Posts: 111
Joined: Sun Mar 05, 2017 9:56 am

[Help] My array won't change when looping pages

Post by Epton »

Why does my tease get stuck on 1 phrase out of the array?
My tease is looping between 3 pages.

I've used this code

Code: Select all

var rest = [
"No touching",
"Hands on head",
"Hands up high in the air",
"Hands behind the head",
"Sit on your hands"
]

var restRandom = rest[Math.floor(Math.random()*rest.length)]
Thamrill
Explorer At Heart
Explorer At Heart
Posts: 265
Joined: Thu Jan 03, 2013 4:55 pm
Gender: Male
Sexual Orientation: Straight
I am a: Submissive

Re: [Help] My array won't change when looping pages

Post by Thamrill »

Epton wrote: Fri Feb 11, 2022 1:00 pm Why does my tease get stuck on 1 phrase out of the array?
My tease is looping between 3 pages.

I've used this code

Code: Select all

var rest = [
"No touching",
"Hands on head",
"Hands up high in the air",
"Hands behind the head",
"Sit on your hands"
]

var restRandom = rest[Math.floor(Math.random()*rest.length)]
Just tested it out and multiple invocation of "rest[Math.floor(Math.random()*rest.length)]" provides all the results.

Just to be sure, you are invoking "restRandom = rest[Math.floor(Math.random()*rest.length)]" everytime you expect a new result, right?
Image

Image

Image
Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests