local EmptyCup = script.Parent
local plr = game.Players.LocalPlayer
local ToolUi = game.Players.LocalPlayer.PlayerGui:WaitForChild("ToolUi")
local Im = ToolUi.ImageLabel
local TweenService = game:GetService("TweenService")
local mouse = plr:GetMouse()
EmptyCup.Activated:Connect(function()
wait(0.1)
if plr.leaderstats.Storage.Value >= 25 then
plr.leaderstats.Storage.Value = 25
-- Make a sell Button Pop up
return
end
wait(1)
plr.leaderstats.Storage.Value = plr.leaderstats.Storage.Value + 1
local ImClone = Im:Clone()
ImClone.Parent = ToolUi
local Rand = math.random(1,5)
print(Rand)
if Rand == 1 then
ImClone.Position = UDim2.new(0.16,0,0.8, 0)
ImClone.Name = "ImClone1"
ImClone:TweenPosition(
UDim2.new(0.16, 0,-0.3, 0),
"Out",
"Bounce",
2,
true,
nil
)
elseif Rand == 2 then
ImClone.Position = UDim2.new(0.32,0,0.8, 0)
ImClone.Name = "ImClone2"
ImClone:TweenPosition(
UDim2.new(0.32, 0,-0.3, 0),
"Out",
"Bounce",
2,
true,
nil
)
elseif Rand == 3 then
ImClone.Position = UDim2.new(0.48,0,0.8, 0)
ImClone.Name = "ImClone3"
ImClone:TweenPosition(
UDim2.new(0.48, 0,-0.3, 0),
"Out",
"Bounce",
2,
true,
nil
)
elseif Rand == 4 then
ImClone.Position = UDim2.new(0.64,0,0.8, 0)
ImClone.Name = "ImClone4"
ImClone:TweenPosition(
UDim2.new(0.64, 0,-0.3, 0),
"Out",
"Bounce",
2,
true,
nil
)
elseif Rand == 5 then
ImClone.Position = UDim2.new(0.80,0,0.8, 0)
ImClone.Name = "ImClone5"
ImClone:TweenPosition(
UDim2.new(0.80, 0,-0.3, 0),
"Out",
"Bounce",
2,
true,
nil
)
end
end)
here is the script that changes the value when the player clicks the tool the Activated event fires and all of these other things happen