#why code broken?

1 messages · Page 1 of 1 (latest)

red mauve
#
for _,v in pairs(eatTool.Food.Glass.Drink:GetChildren()) do
    if v.Color == Color3.fromRGB(0,0,0) then
        print("Cursed drink")
        DataManager.remScore(Player, 20)
    elseif v.Color == Color3.fromRGB(255,255,0) then
        print("Blessed drink")
        DataManager.addScore(Player, 30)
    else
        print("Normal drink")
        DataManager.addScore(Player, 5)
    end
    print("test")
    if v.Size.Y == 0.431 then
        print("hi")
        v.Size = Vector3.new(0.53,0.331,0.492)
    elseif v.Size.Y == 0.331 then
        v.Size = Vector3.new(0.53,0.231,0.492)
    elseif v.Size.Y == 0.231 then
        v.Size = Vector3.new(0.53,0.131,0.492)
    elseif v.Size.Y == 0.131 then
        fireTool:FireClient(Player, "drop")
        eatTool:Destroy()
    end
end

basically its a glass with a mesh inside it (drink) i want it to change size every time you 'take a sip' if that makes sense

anyways
print("test") will output BUT
print("hi") will not... and the drink mesh wont change size

#

i know i use :getChildren BUT theres only one item inside of the Drink folder not sure why i use a for loop but that shouldnt matter the first half runs fine the second half of the code does not

stuck night
#

because u set 0.431 as a number u have to set it as a vector

red mauve
#
if v.Size.Y == Vector3.yAxis(0.431)

like this?

stuck night
#

ummmm its Vector.new

#

if u wanna change siE

#

size

red mauve
#

nah i just want to read the size first - i do use vector3.new for changing the size

stuck night
#

yes

red mauve
#

ah okay

#

brb let me test

#
if v.Size == Vector3.new(0.53,0.431,0.492) then
  print("hi")
  v.Size = Vector3.new(0.53,0.331,0.492)
elseif v.Size == Vector3.new(0.53,0.331,0.492) then
  v.Size = Vector3.new(0.53,0.231,0.492)
elseif v.Size == Vector3.new(0.53,0.231,0.492) then
  v.Size = Vector3.new(0.53,0.131,0.492)
elseif v.Size == Vector3.new(0.53,0.131,0.492) then
  fireTool:FireClient(Player, "drop")
  eatTool:Destroy()
end

tried this didnt work still not sure

stuck night
#

whats error in outpy

red mauve
#

hi still not print

#

no error

stuck night
#

full code

red mauve
stuck night
#

also whats v suppose to be

red mauve
#

a meshpart

#

here

stuck night
#

not output

stuck night
#

ima sleep then

red mauve
#

hold on i getting screenshot of the hierachy

daring fulcrumBOT
#

studio** You are now Level 8! **studio

red mauve
#

the drink is welded to the glass

stuck night
#

bro code

red mauve
#

bruh how much code do you need im just changing the size of one mesh part

stuck night
#

I need to see context

#

u only show the 2 lines that errors

red mauve
#

alr well give me a min

#

code is kinda all over the place i only sent what was relevant

stuck night
#

ok show whats relevant brk

#

Taken a full 10 mins to show code

#

insane

red mauve
#

lol what

stuck night
#

and your still not showing code

#

ok ima sleep then

red mauve
#

bro the fucking thing is broken

#

its pasting with 200 spaces

stuck night
#

Bro

red mauve
#

go to sleep

stuck night
#

Show the for liop

#

k bye

red mauve
#

i cant send it

#

it just comes out like this

#

and says this

#

also @stuck night dude read from the top next time - i just realised you read one line

thorny prairie
red mauve
#

alr cheers man

#

ill do that thanks!

red mauve
#

which would definitely be read by the if statement as a different number