#how can i reverse a click detector

1 messages · Page 1 of 1 (latest)

lost grail
#

I want to make it so that when i click on "Part1" again, the part goes smaller

fair sedge
#

Just set the 10 in goals to part2.Size - 0.5 or smth for each of them

lost grail
#

wdym

fair sedge
#

If you want it to get smaller every click just replace the constant 10 with the parts size minus an amount

lost grail
fair sedge
#

Create 2 separate tweens depending on the current size

lost grail
#

okay

#

in the same script?

fair sedge
#

Yea?

#

It's just a simple if statement

#

Did that work?

lost grail
#

im not too sure where to put it

#

:/

fair sedge
#

In the function

#

If you know how tweens work you should know a simple if statement

#

💀

fair sedge
#

He wants it to get bigger then smaller then bigger then smaller

#

But only size change when it's clicked

empty tangle
#

part.Size = part.Size - Vector3.new(-1, -1, -1,)

empty tangle
#

Make a variable if its been activated once or not

fair sedge
#

True

#

Or just check the size

empty tangle
fair sedge
#

He says he doesn't know where to put an if syatement

#

Like bruh

empty tangle
#

That wouod work but jts unreliavle

#

*unreliable

fair sedge
#

Yea just have a bool value

empty tangle
#

actually, nevermijd that would be better but its a bit different

#

i forgot how to check if a part has a higher value than the other whoops.

#

@lost grail

#
  • Make a variable so youll know if its been activated, (true/false)

and youll probably figure out the rest

#

just Fuck Around & Find Out

lost grail
#

ive just made this rn

#

but isnt really working

fair sedge
#

Huh?

#

If part 2 == goals?

empty tangle
fair sedge
#

You need do compare the sizes

empty tangle
#

ill hop on pc latee and help you

fair sedge
#

How does he know tweens but not if statements bro

#

I wouldn't be surprised if it was AI actually

empty tangle
# lost grail

but for now, why not try a Boolean Value, if your confused about on how to do it then trg what ThatOneCookie said

#

i forgot how to compare Vector3 sizes so

lost grail
fair sedge
#

If part.size == Vector3.new(1, 1, 1)

#

But replace the 1 with whatever size it is

empty tangle
lost grail
fair sedge
#

Then do else for the other case

empty tangle
#

are we deadass?

fair sedge
#

Or if part.size > Vector3.new(1,1,1)

empty tangle
#

its >= or <=

#

from my understanding of lua

fair sedge
#

Well you could check an exact value if you need

#

== works

empty tangle
#

;compile

local function num(a)
 if a >= 100 then
  print("hi")
 elseif a <= 100 then
  print("bye")
 end
end

num(101)
num(98)
wooden craneBOT
#
Program Output
hi
bye

empty tangle
#

;compile

local function num(a)
 if a > 100 then
  print("hi")
 elseif a < 100 then
  print("bye")
 end
end

num(101)
num(98)
wooden craneBOT
#
Program Output
hi
bye

empty tangle
#

both works

fair sedge
#

Yes but he wants to check and exact size because the size he is making it go to is constant

empty tangle
fair sedge
#

It's just switching between 2 sizes

lost grail
#

i got it working now

empty tangle
#

howd u fix it?

fair sedge
#

Alr, good luck on the project

lost grail
#

sorry for taking the time out from u guys

fair sedge
#

All good

lost grail
fair sedge
#

I'm bored rn anyways

empty tangle
#

eh im bored, no time was taken away

fair sedge
#

Yea

#

Same lol

lost grail
#

just practicing on random things

fair sedge
#

Good job 👍

lost grail
#

thanks 🙂

fair sedge
#

Good luck

empty tangle