#My code isn't Working now that i Added the Current Order Value to it, Any ideas to fix it?

13 messages · Page 1 of 1 (latest)

opal yoke
#

`local SellPoint = script.Parent
local CurrentOrder = game.Workspace.Values.CurrentOrder
local OrderCompleted = game.Workspace.Values.OrderComplete

SellPoint.Touched:Connect(function(Shape)
if CurrentOrder == 1 then
if Shape:HasTag("Cube") then
print(Shape.Parent.Name)
Shape:Destroy()
end

elseif CurrentOrder == 2 then
    if Shape:HasTag("Wedge") then
        print(Shape.Parent.Name)
        Shape:Destroy()
    end
    
elseif CurrentOrder == 3 then
    if Shape:HasTag("Wedge") then
        print(Shape.Parent.Name)
        Shape:Destroy()
    end
end

end)`

vocal creek
#

Can you send the error in console?

opal yoke
#

thats the thing

#

there is none

#

at all

safe pewter
#

if its a numbervalue in workspace then u should do CurrentOrder.Value == whatever u want

opal yoke
#

OH

#

SHOOT

#

I REALIZED MY MISTAKE

vocal creek
#

Ok here’s what to do

opal yoke
#

im a idiot

vocal creek
#

In the future do this to debug:
add print statements to all layers of code (to figure out where it’s stopping)
Figure out why it’s stopping (Usually if statements not activating)
Figure out how to solve it from there