The local script is supposed to make the following part invisible but it isnt working
heres the local script:
local Cheese = game.Workspace.LevelOne.Cheese
local Meat = game.Workspace.LevelOne.Meat
local Buns = game.Workspace.LevelOne.Buns
local arrow = game.Workspace.LevelOne.Model.Touch
local text = script.Parent
local players = game:GetService("Players")
local level = players.LocalPlayer:WaitForChild("Level")
local gold = players.LocalPlayer:WaitForChild("Gold")
local textvalue = 0
local ingredients = 0
local function UpdateText()
textvalue += 1
if level.Value == "Tutorial" then
text.Text = textvalue.. " / 3 Find Cheese, Meat, and Buns"
elseif level.Value == "LevelOne" then
text.Text = textvalue.. " / 3"
end
end
if level.Value == "LevelOne" then
Cheese.Touched:Connect(function()
print("touched")
UpdateText()
Cheese.Transparency = 1
Cheese.CanTouch = false
ingredients += 1
if ingredients == 3 then
text.Text = "You got the Ingredients, Now go to the house"
text.TextSize = 20
arrow.BillboardGui.ImageLabel.Visible = true
end
end)
Meat.Touched:Connect(function()
print("touched")
UpdateText()
Meat.Transparency = 1
Meat.CanTouch = false
ingredients += 1
if ingredients == 3 then
text.Text = "You got the Ingredients, Now go to the house"
text.TextSize = 20
arrow.BillboardGui.ImageLabel.Visible = true
end
end)
Buns.Touched:Connect(function()
print("touched")
UpdateText()
Buns.Transparency = 1
Buns.CanTouch = false
ingredients += 1
if ingredients == 3 then
text.Text = "You got the Ingredients, Now go to the house"
text.TextSize = 20
arrow.BillboardGui.ImageLabel.Visible = true
end
end)
arrow.Touched:Connect(function()
if ingredients == 3 then
script.Parent.Parent.Parent.Parent.Parent.Special.YouWon:TweenPosition(UDim2.new(0.256,0,0.143,0), "Out", "Quad",1,true)
script.Parent.Parent.Parent:TweenPosition(UDim2.new(0.236,0,800,0), "Out", "Quad",1,true)
textvalue = 0
ingredients = 0
text.TextSize = 50
arrow.BillboardGui.ImageLabel.Visible = false
if level.Value == "Tutorial" then
script.Parent.Parent.Parent.Parent.Parent.Special.YouWon.Frame.Coins.Text = "Coins : 15"
end
end
end)
end