So I’m trying to make a core game. But the only problem is, I haven’t figured out how to get a meltdown working.
Because what is going to happen is there is going to be 6 lasers (2 are extra lasers) and if all the lasers are on for 7 - 10 minutes, then the core will explode and a meltdown will occur.
This is my code currently:
local on = false -- DO NOT TOUCH
local core = workspace.Core
local laser5 = core.MainLaser5
local beam1 = laser5.Extra.mid
local beam2 = laser5.Laser1.e
local beam3 = laser5.Laser2.e
local laser6 = core.MainLaser6
local beam4 = laser6.Extra.mid
local beam5 = laser6.Laser1.e
local beam6 = laser6.Laser2.e
function activation()
workspace["Core Interaction"].Button.ClickDetector.MaxActivationDistance = 0
on = true
script.Parent.Music:Play()
script.Parent.ClickDetector.MaxActivationDistance = 0
script.Parent.Color = Color3.fromRGB(64, 221, 21)
beam1.Transparency = 0
beam2.Transparency = 0
beam3.Transparency = 0
beam4.Transparency = 0
beam5.Transparency = 0
beam6.Transparency = 0
wait(18)
workspace["Core Interaction"].Button.ClickDetector.MaxActivationDistance = 10
end
function deactivation()
script.Parent.Shutdown:Play()
on = false
script.Parent.ClickDetector.MaxActivationDistance = 0
script.Parent.Color = Color3.fromRGB(127, 0, 0)
beam1.Transparency = 1
beam2.Transparency = 1
beam3.Transparency = 1
beam4.Transparency = 1
beam5.Transparency = 1
beam6.Transparency = 1
end
script.Parent.ClickDetector.MouseClick:Connect(function()
if on == false then
activation()
script.Parent.ClickDetector.MaxActivationDistance = 0
wait(1)
script.Parent.ClickDetector.MaxActivationDistance = 10
else
deactivation()
script.Parent.ClickDetector.MaxActivationDistance = 0
wait(1)
script.Parent.ClickDetector.MaxActivationDistance = 10
end
end)
You do know that were supposed to help you not completely give you a working game? Never make a statement that game is gonna come out before you can complete it.
So I’m trying to make a meltdown system, but I do not know how to set it if the all the lasers are on at the same time for like 10 - 20 minutes, then the core explodes and it becomes a meltdown.
That’s a solution to a question what is tick() You could try something like that lets say 10 minutes then tick would count 600 seconds and then you do the thing etc. Hope this helps!
That helped a little bit. But I’m still confused, how would I be able to make it if the value on == true for more than 10 minutes, it activates meltdown?
local MDTime = 600
if on == true then
local current_time = tick()
wait(MDTime)
if current_time > MDTime
print("Meltdown")
elseif on == false then
end
why are you running a check if the script is forced to wait the required amount of time? I haven’t read the original script yet so my bad if I missed something, I’ll read it after this post
@TeamDreams123 Also I don’t know if this is known but the core games you reference don’t go off this method to check whether a meltdown should occur or not. Instead, they use a value that acts as the “Temperature” of the core. When the core exceeds a specific temperature, they will trigger the meltdown. they usually have a set increase depending on a few factors, like multiple lasers that add to the temperature more depending on how much are on. This allows you to have more control since you can set different things to happen at certain temperatures.
If you weren’t aware of this, I would personally suggest switching to this since I can turn off 1 laser in your game and the timer would technically be reset based off how you’ve described how it works. (The moment all your lasers turn on, given this current script, a meltdown is guaranteed anyway since turning off the lasers won’t stop the Wait() and you don’t check if all the lasers are still on, only if the required time has passed in which it has since you forced the script to wait it out. I assumed this is a button only you or other devs can press to test if the meltdown works but then it adds the question of why it’d need a 10 minute startup)
If you chose to go with this method then that’s all good, I just figured that the former method made more sense.
Well default(normal) temperature can be like 70 degrees or something once you activate it it goes up by seconds etc. by 1 or more degrees and until its like 5000 degrees it can explode. That how i would go for it
make a script that changes the number value’s value depending on laser activation ( 1 laser activate = -2 temp per sec, 2 laser activate = +2 temp per sec )
make a script that when the number value’s value reaches 0 or 3000 ( any number u want ) then the freezedown or meltdown happens
No problem, I am curious as to why you would give a release date if you are uncertain of its release. I’m sure something unexpected can come up but I would only give a release date if you are absolutely sure that you can push the game out on the given date. It’s a very easy mistake to say that one thing can happen and quickly overestimate yourself on the matter, causing aforementioned delays and tight deadlines.
There are quite a few games I can call off the top of my head that get negative reception for doing this even if they show progress towards their next update / release. Stating a release date is placing that upon the trust of whatever community you have given it to and if that line is bent too much, then the actual picture becomes distorted and trust becomes scepticism. You’ll want to maintain that trust carefully as it can make or break your game’s activity. If you don’t care about activity then there’s still other factors that get affected like reputation and whatnot. It’s a thing that shouldn’t be taken lightly.
A temperature system doesn’t seem like a hard thing to implement but as you said, you’re a beginner so I wouldn’t add more pressure than what you already have, you can try change it after the release when you’ve lifted any deadlines you’ve given yourself
Anyway, I don’t think scripting support is the place to talk about all that, Is the code working as intended?