Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Tools Ingame Visible to you but Invisible to Everyone else?

I opened a shop on the game and you have to use coins to purchase it. Thing is the Tools Ingame Visible to you but Invisible to Everyone else

local player=game.Players.LocalPlayer
local leaderboard=player:WaitForChild("leaderstats")
local button=script.Parent
local price=button:WaitForChild("Price")
local item=button:WaitForChild("ItemName")
local rs=game:GetService("ReplicatedStorage")
local createPartEvent = rs:WaitForChild("Purchase")

button.MouseButton1Click:connect(function()
 if leaderboard.Coins.Value>=price.Value then
 createPartEvent:FireServer( leaderboard.Coins.Value==leaderboard.Coins.Value-price.Value)
  local item=rs:WaitForChild(item.Value)
  item:Clone().Parent=player.StarterGear
     item:Clone().Parent=player.Backpack

 end
end)

while wait()do
 button.Text=item.Value.."-"..price.Value
end

4 comments

0

Filtering Enabled is on?

0

Yes, filtering enabled, this is in a button and it is a LOCAL script

0

The tool is probably not compatible with filtering enabled

0

I made the tool, like the other tools that works on the game, the code isn't mine but the tools are, so how do I get it to work?

1 answer

✓ Accepted answer

Create a RemoteEvent that clones the tool

Local Script:

local rs = game:GetService('ReplicatedStorage')
local GiveToolEvent = rs:WaitForChild("GiveTool")

button.MouseButton1Click:connect(function()
	if leaderboard.Coins.Value>=price.Value then
		createPartEvent:FireServer( leaderboard.Coins.Value==leaderboard.Coins.Value-price.Value)
		GiveToolEvent:FireServer(item.Value)
	end
end)

Server Script:

local rs = game:GetService('ReplicatedStorage')
local GiveToolEvent = rs:WaitForChild("GiveTool")

GiveToolEvent.OnServerEvent:connect(function(player, toolname)
	local tool = rs:FindFirstChild(toolname)
	tool:Clone().Parent = player.StarterGear
	tool:Clone().Parent = player.Backpack
end)

This discussion is preserved as it was. New answers, comments, and votes are closed.