local prompt = script.Parent
local glass = script.Parent.Parent.Parent.Glass1
local glassFolder = script.Parent.Parent.Parent.Glass2 -- Folder or Model containing the unions
local money = game.Workspace:WaitForChild("GetMoney").Jewelvalue.Value
local music = game.Workspace:WaitForChild("soundarea").Music
local alarm = game.Workspace:WaitForChild("soundarea").alarm
local breakk = game.SoundService.GlassBroking
prompt.Triggered:Connect(function()
glass.Transparency = 1
glass.CanCollide = false
for _, obj in pairs(glassFolder:GetChildren()) do
if obj:IsA("UnionOperation") then
-- Modify the properties of all unions inside Glass2
obj.CanCollide = true -- Ensure it looks like glass
obj.Transparency = 0.6 -- Light blue tint
end
end
prompt.Enabled = false
money += math.random(100, 300)
print("Money got: "..money)
if alarm.Playing == false then
alarm:Play()
end
if music.Playing == false then
music:Play()
end
breakk:Play()
task.wait(300)
prompt.Enabled = true
glass.Transparency = 0.6
glass.CanCollide = true
for _, obj in pairs(glassFolder:GetChildren()) do
if obj:IsA("UnionOperation") then
-- Modify the properties of all unions inside Glass2
obj.CanCollide = false -- Ensure it looks like glass
obj.Transparency = 1 -- Light blue tint
end
end
end)