I need help with a block code

Go into the property device’s settings. Have it broadcast on a channel like ‘update’ when the value changes.
Then, go into the game overlay’s block code, and create a new block under 'when receiving on channel ‘update’ '. Make it have this code:

{ set content [ get property ("insert property" ) ] } 
1 Like

I used the max ammount of blocks on a game overlay (6) and made them all: Set property value to - (the property) - (The value) Would that work?

could you please show screenshots of each block code and the settings menu?
edit: wait, are you trying to make a game overlay clock?

@Godspawnking
What would you like the name of your property to be???
Just so I can show you an example…

And also…
What would you like the time interval to be???

@godspawnking , it looks like @BountyHunterX is trying to help you as well. Do you need my help as well, or are they giving you the info you need?

Not exactly. I’m trying to make it so it starts at 9:00am and update it to 2 hours have passed until it reaches 7:00pm in a game overlay
Project 1
Project 1 part 2

Oh. That explains a lot. Let me see what I can do in that case…

Oh boy. You’re using a different block for each time. That takes up a lot of memory. I’m sorry to say, but you’ll need to get rid of all the blocks you’ve created if you want to make this work smoothly. I’ll walk you through the steps if you want.

Explain a simpler way then. You understand what I’m doing now, right?

1 Like

@Godspawnking
I can too. I think I understand what you’re trying to do now. I still need a property name and a time interval, though.

You want them to play for two hours???

The property name is “Time”, and it starts at 9:00am, and increases every 2 hours when receiving on a channel, and it ends at 7:00pm

No! That’s how much time goes by after they do a certain task

So how long in your game is 2 hours???
Like is 2 hours equal to 10 minutes, or something else…
I can’t imagine anyone playing your game for two hours or more straight unless it’s really, really, good (no offense).

Probably my last question, depending on your answer, @Godspawnking.

1 Like

No! When they interact with something, it updates the property “Time” by increasing the original time by two hours

Okay. I think I can help you now. Let me upload some screenshots for a tutorial…

@Godspawnking
You want to end the game when it reaches 7:00 PM, right?

no, I want the players position to reset back to spawn and the properties and overlay to be reset. My game is a time loop game, if it’s any conselation. It will loop seven times before the game ends

Okaaaaaaaaayyyyyyyyyy. I’ll see what I can do. Sorry if I’m taking too long…

It’s ok. I understand this is complicated.

Yes. You have 6 different blocks for 6 different times. Instead, we can narrow it down to 1. This is how:
Step 1.
Create a trigger that broadcasts to itself, let’s call the channel tick. Tick will not be the channel that the overlay receives from, though. Set the trigger delay to however long you want the interval inbetween time changes, like 30 seconds or whatever. Also make sure you wire a device that triggers it for the first time to start the trigger clock.
Step 2.
Create a block for the trigger under when triggered, and have it broadcast on the channel timechange. Now we can get into the overlay’s code.
Step 3.
Set the default value of the time property to 9. Set the overlay’s default text to 9:00 AM as well. Create a new block for the overlay under when receiving on channel 'timechange' . Now, the code.
Step 4.
Have the code set to this:


This should work, let me know.
Make sure to read the whole reply.

2 Likes