Jump to content

Is this really not possible???


Qwej

Recommended Posts

Does anyone know if it is possible to make a script that does this; 

First 5 minutes from server start make ONLY stone breakable. Next 5 minutes make ONLY coal breakable.

This must run by itself in a loop... I dont want any server restart/update that will stop the game.

I want a game that by time intervals changes what block type can be mined!

Think this is impossible 🤔

Link to comment
Share on other sites

This is possible for sure! You could try something like this:

on server start:
	set {allowed_block} to stone
	wait 5 minutes
	set {allowed_block} to coal ore

on break:
	if event-block isn't {allowed_block}:
		cancel event
		send "&cThe current phase is &f%{allowed_block}%&c!" to player

If you want to restart the timer you could just reload the skript, like this:

Quote

/sk reload <filename>.sk

Of course it could be done using other types of loops, but this might be the easiest way.

Edited by Znyx
Misspell!
Link to comment
Share on other sites

Hey thanks man 😄

I havent had time to try it yet, but it looks legit. I just dont see where the looping comes in? What happens when the first 2 times 5 minutes has passed?

Well im total script noob 😅 just started to try and learn... Im struggling with knowing what kind of words and phrases is useable... Can it be looked up somewhere maybe?

For example How do u know how to write 'on break' and not 'on mine' or 'when break' or whatever else...

Link to comment
Share on other sites

2 hours ago, Qwej said:

Hey thanks man 😄

I havent had time to try it yet, but it looks legit. I just dont see where the looping comes in? What happens when the first 2 times 5 minutes has passed?

Well im total script noob 😅 just started to try and learn... Im struggling with knowing what kind of words and phrases is useable... Can it be looked up somewhere maybe?

For example How do u know how to write 'on break' and not 'on mine' or 'when break' or whatever else...

on break is called when any block is broken

on mine is called when the block drops an item. for example if you break a stone block with a pickaxe, a stone/cobblestone block will be dropped and the on mine event will be called

link to the events: https://skripthub.net/docs/?id=996

Edited by ApexSplat

Discord: Dead#6905

Love anime!


Anime Gifs

Link to comment
Share on other sites

I didn't make any loop in my example, here's how it might look with one:

on server start:
	set {allowed_block} to stone
	wait 5 minutes
	set {allowed_block} to coal ore
	execute console command "sk reload <filename>"

on break:
	if event-block isn't {allowed_block}:
		cancel event
		send "&cThe current phase is &f%{allowed_block}%&c!" to player

That would probably work, but I would recommend doing something like this instead:

on server start:
	set {allowed_block} to stone

loop every 5 minutes:
	if {allowed_block} is stone:
		set {allowed_block} to coal ore
	else if {allowed_block} is coal ore:
		set {allowed_block} to iron ore
	else if {allowed_block} is iron ore:
		set {allowed_block} to stone # Resets the blocks
	send "&cThere's now a new phase!" to all players

on break:
	if event-block isn't {allowed_block}:
		cancel event
		send "&cThe current phase is &f%{allowed_block}%&c!" to player

 

Link to comment
Share on other sites

  • 2 weeks later...

Thanks again 😄

With a few modifications i finally got this script to work as intended:

on server start:
    set {allowed_block} to stone

loop every 5 minutes:
    if {allowed_block} is stone:
        set {allowed_block} to coal ore
    else if {allowed_block} is coal ore:
        set {allowed_block} to iron ore
    else if {allowed_block} is iron ore:
        set {allowed_block} to stone # Resets the blocks
    send "&cThere's now a new phase!" to all players

on break:
    if event-block isn't {allowed_block}:
        cancel event
        send "&cThe current phase is &f%{allowed_block}%&c!" to player

 

Thanks very much! Now the question is if it is possible randomize wich block-event starts after each 5 minutes??

So instead of having the 'allowed block' change after a pattern in the loop... Can u make it pick a random one? Maybe the same again, or another one from the list

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...