This should give the clicker a tool and take away 35 Cash. If they already have the tool in their inventory then it activates a Gui. However this only works in Play Solo and it's fine in Play Solo but when I play the game it doesn't do a thing. The LOCAL script is located in the starter pack.
local Player = game.Players.LocalPlayer.Character
local Plr = game.Players.LocalPlayer
function onClicked()
if Player then
if not Plr.Backpack:findFirstChild("Spring Rolls") then
local a = game.ServerStorage["Spring Rolls"]:Clone()
a.Parent = Plr.Backpack
local amount = 35
local h = Player:findFirstChild("Humanoid")
if (h~=nil) then
local thisplr = game.Players:findFirstChild(h.Parent.Name)
if (thisplr~=nil) then
local stats = thisplr:findFirstChild("leaderstats")
if (stats~=nil) then
local Bill = stats:findFirstChild("Cash")
if (Bill~=nil) then
Bill.Value = Bill.Value - amount
end
end
end
end
elseif Plr.Backpack:findFirstChild("Spring Rolls") then
Plr.PlayerGui.Already.TextLabel.Script.Disabled = false
end
end
end
game.Workspace["Spring Rolls"].ClickDetector.MouseClick:connect(onClicked)
