hello. i am trying to change this touch connect to a proximity prompt. this is what i have tried but it does not work. how would i get this working? many thanks
script.Parent.Touched:Connect(function(hit)
if hit.Parent:IsA(“Tool”) then
if hit.Parent.Name == “Empty Milkshake Glass” then
if hit.Parent.Value.Value == 4 then
if hit.Parent.On.Value == false then
hit.Parent.On.Value = true
hit.Parent.Name = “Vanilla Milkshake”
script.Parent.Transparency = 0.3
wait(2)
hit.Parent.FullVan.Transparency = 0
hit.Parent.drinkVan.Disabled = false
hit.Parent.Straw1.Transparency = 0
hit.Parent.Straw2.Transparency = 0
script.Parent.Transparency = 1
end
end
end
end
end)
local prompt = script.Parent.ProximityPrompt
prompt.Triggered:Connect(function(hit)
if hit.Parent:IsA(“Tool”) then
if hit.Parent.Name == “Empty Milkshake Glass” then
if hit.Parent.Value.Value == 4 then
if hit.Parent.On.Value == false then
hit.Parent.On.Value = true
hit.Parent.Name = “Vanilla Milkshake”
script.Parent.Transparency = 0.3
wait(2)
hit.Parent.FullVan.Transparency = 0
hit.Parent.drinkVan.Disabled = false
hit.Parent.Straw1.Transparency = 0
hit.Parent.Straw2.Transparency = 0
script.Parent.Transparency = 1
end
end
end
end
end)