#Less than check

62 messages · Page 1 of 1 (latest)

icy garden
#

What i'm trying to do is check if a int value is less than 1 if it is then enable an attacking script
and disable another
i'll send over my script(s)

#

Stage is the intvalue

#

I will grab the others in a few seconds

stone nebula
#

int value?

#

only thing below 1 is 0 and negative numbers

icy garden
#

Attacking script that is disabled by default

#

i don't see any reason to open that one

icy garden
stone nebula
#
if stage < 1 then
     --blahblah la
else
     --blh
icy garden
#

Nope

rich shell
#

then do

if Stage <= 1 then

script.Parent.AI.Enabled = true

script.Parent.Part.Script.Enabled = false
#

if I'm understanding this correctly

exotic ridge
#

Why not using module script

#

@icy garden

icy garden
#

Why would i need a module script

#

What does a module script do that a server script doesnt?

exotic ridge
#

Enabling / Unenabling scripts is the best unefficient practice

icy garden
icy garden
exotic ridge
#

Yep

#

Use module script functions

icy garden
#

I am very very unfamiliar with module scripts

#

nvm

#

all scripts

#

i am unfamiliar with

stone nebula
#

satan whenever he has the opportunity to bring up modulescript functions:

icy garden
#

Do module scripts work in the workspace

#

or do they need to be in something like serverscriptservice

exotic ridge
#

And oop for custom npc

icy garden
#

Alright i'll look up an intro to it

#

oop?

exotic ridge
#

Object oriented programming

rich shell
#

I wanna recommend u a channel that's been helping me learn oop but yt is broken rn

icy garden
#

yt is broken?

#

huh..

exotic ridge
#

Huh

rich shell
#

my subscriptions wont show

#

found him, I suggest watching crockpot dev

#

he taught me a lot about oop within' the span of 2 days

#

the other is B Ricey who is also helpful teaching all that

icy garden
#

I don't understand how people could possibly be happy whilist scripting

rich shell
#

I hate it 70% of the time

icy garden
rich shell
#

but when you finish the script it's like angels lifting you up into the sky and handing you an imaginary cookie

#

also the pain is worth it when you can bring your game ideas to life ;)

icy garden
#

Man I haven't even started learning

#

i wish i just had some sort of team

#

maybe i should try and ask the ai thingy

#

thats lazy

#

but i could still try it

#

maybe this'll work

#

local intValue = script.Parent -- Assuming the IntValue is a child of the script

local woahwoahwoahScript = game.Workspace.Woahwoahwoah -- Replace "Workspace.Woahwoahwoah" with the path to your "Woahwoahwoah" script
local hmmmmmScript = game.Workspace.hmmmmm -- Replace "Workspace.hmmmmm" with the path to your "hmmmmm" script

intValue.Changed:Connect(function(newValue)
if newValue < 1 then
woahwoahwoahScript.Disabled = true
hmmmmmScript.Disabled = false
else
woahwoahwoahScript.Disabled = false
hmmmmmScript.Disabled = true
end
end)

icy garden
#

IT FUCKING WORKS

#

YEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH

#

now i feel like shit because i got ai to do it

#

now why is disabling scripts ineffecient

#

and does it really matter

rich shell
#

still make your own scripts, but it doesn't hurt to ask the ai for a script since half the time the script is wrong (unless the script is simple)

#

then u can debug and enjoy coding in the pits of 🔥 because you spend 5 hours fixing a simple typo😢 😢 😢 😢 😢