the only problem is this script doesnt work anymore.
local RP = game:GetService("ReplicatedStorage")
local Events = RP.Events
local prompt = workspace.Cafe.Inside.Plate.Placement.ProximityPrompt
local folder = game.Workspace.Cafe.Inside.Plate.Placement.Items
prompt.Triggered:Connect(function(plr)
for _,v in pairs(folder:GetChildren()) do
if v:IsA("Part") then
print("There is something inside of the folder! Checking the name;"..v.name.Value)
if v.name.Value == "Muffin" then
script.Parent.EndingName.Text = "Muffin"
script.Parent.Desc.Text = "It was stale due to being left out for too long. Gross!"
elseif v.name.Value == "Donuts" then
script.Parent.EndingName.Text = "Donuts"
script.Parent.Desc.Text = "How are you gonna finish them all?"
end
end
end
end)
thats weird cuz i checked on the client side and it still shows up in the folder? and also for this seperate script
local RP = game:GetService("ReplicatedStorage")
local Events = RP.Events
local prompt = workspace.Cafe.Inside.Plate.Placement.ProximityPrompt
script.Parent.ChildAdded:Connect(function(item)
prompt.Triggered:Connect(function(plr)
local inv = plr:FindFirstChild("Inventory")
for _,v in pairs(inv:GetChildren()) do
if v:IsA("Part") then
print("Player has an item! Detecting if it's purchased or not...")
if v.Purchased.Value == false then
print("You need to purchase the item first!")
else
print("Player has purchased item! Giving ending..")
item:Destroy()
end
end
end
end)
end)
it works completely fine, prints stuff and everything
local RP = game:GetService("ReplicatedStorage")
local Events = RP.Events
local prompt = workspace.Cafe.Inside.Plate.Placement.ProximityPrompt
local folder = game.Workspace.Cafe.Inside.Plate.Placement.Items
prompt.Triggered:Connect(function(plr)
for _,v in pairs(folder:GetChildren()) do
print("test")
if v:IsA("Part") then
print("There is something inside of the folder! Checking the name;"..v.name.Value)
if v.name.Value == "Muffin" then
script.Parent.EndingName.Text = "Muffin"
script.Parent.Desc.Text = "It was stale due to being left out for too long. Gross!"
elseif v.name.Value == "Donuts" then
script.Parent.EndingName.Text = "Donuts"
script.Parent.Desc.Text = "How are you gonna finish them all?"
end
end
end
end)
local RP = game:GetService("ReplicatedStorage")
local Events = RP.Events
local prompt = workspace.Cafe.Inside.Plate.Placement.ProximityPrompt
local folder = game.Workspace.Cafe.Inside.Plate.Placement.Items
prompt.Triggered:Connect(function(plr)
for _,v in pairs(folder:GetChildren()) do
print("test")
if v:IsA("BasePart") then
print("There is something inside of the folder! Checking the name;"..v.name.Value)
if v.name.Value == "Muffin" then
script.Parent.EndingName.Text = "Muffin"
script.Parent.Desc.Text = "It was stale due to being left out for too long. Gross!"
elseif v.name.Value == "Donuts" then
script.Parent.EndingName.Text = "Donuts"
script.Parent.Desc.Text = "How are you gonna finish them all?"
end
end
end
end)