My game is filtered Enabled.
I have a store ingame that is purchased with tools. You click a part [named Buy] to purchase the item.
How do I get this Tool to be visible with everyone in game
Everytime I try, its not working
The code has a intvalue named Price and a String Value for the name
Thanks for answering in advance. LOCAL SCRIPT
local db= true
local button=script.Parent
local price=button:WaitForChild("Price")
local item=button:WaitForChild("ItemName")
local rs=game:GetService("ReplicatedStorage")
local tool = script.Parent -- the tool
tool.ClickDetector.MouseClick:connect (function(player)
if player.leaderstats.Coins.Value>=price.Value then
player.leaderstats.Coins.Value=player.leaderstats.Coins.Value-price.Value
db = false
workspace.tool:FireServer(tool)-- Fires the RemoteEvent
wait(3) -- wait that extra three seconds
db = true
end
end)
ServerScriptService
workspace.tool.OnServerEvent:Connect(function(player, tool) -- tool is the tool, player is the player that sent the event
tool.BrickColor = BrickColor.new("Bright red") -- poof!
local item=game:GetService("ReplicatedStorage"):WaitForChild(item.Value) -- ERROR LINE
item.Clone().Parent = player.StarterGear -- poof!
item:Clone().Parent=player.Backpack -- poof!
wait(3) -- poof!
tool.BrickColor = BrickColor.new("Bright green") -- poof!
end)
ServerScriptService.Tool:5: attempt to index global 'item' (a nil value) Now the tools will not spawn in the backpack at all now, and I made a RemoteEvent in the workspace and Replicated Storage called tool

2 comments
it seems the server script and local script arent communicating properly, though. it's giving me WaitForChild(item.Value) it is a unknown global item in serverstoragescript
https://i.imgur.com/TUb0YWS.png