Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Tools Ingame Visible to you but Invisible to Everyone else?

Asked by 6 years ago

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
0
Filtering Enabled is on? hellmatic 1523 — 6y
0
Yes, filtering enabled, this is in a button and it is a LOCAL script robloxquestionnaire1 30 — 6y
0
The tool is probably not compatible with filtering enabled hellmatic 1523 — 6y
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? robloxquestionnaire1 30 — 6y

1 answer

Log in to vote
1
Answered by
hellmatic 1523 Moderation Voter
6 years ago
Edited 6 years ago

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)
Ad

Answer this question