local player = game.Players.LocalPlayer
local currency = player:WaitForChild('leaderstats').Points
local amount = 5
local tool = game.ServerStorage:WaitForChild('Firebrand')
script.Parent.MouseButton1Click:connect(function()
if currency.Value >= amount and not player.Backpack:FindFirstChild("Firebrand")or player.Character:FindFirstChild('Firebrand') then
-- They Dont Have it
local newtool = tool:Clone()
newtool.Parent = player.Backpack
else
script.Parent.Text = 'Purchase Failed'
end
end)
COMMUNITY QUESTION
What is wrong with this?
1 answer
ServerStorage is exactly that -- storage for the server -- not the client. LocalScripts do not have access to anything in ServerStorage -- ROBLOX won't bother sending them those files.
If you want to make a model available to clients (i.e., LocalScripts) you have to use ReplicatedStorage.
Also, your order-of-operations is wrong with or, and, and not.
if a and not b or c is interpreted as if (a and (not b)) or c then. Thus the purchase will go through if they have it in their character, even if they don't have enough money.
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
We need to know what is wrong with it in order to answer your question. Do you get errors in output? What does it not do that it's supposed to do?
I can test the game but it does not do anything