local db = true script.Parent.Touched:connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") ~= nil then if db == true then db = false script.Parent.Transparency = 1 local player = game.Players:GetPlayerFromCharacter(hit.Parent) player.leaderstats.Bricks.Value = player.leaderstats.Bricks.Value + 1 script.Sound:Play() wait(1) script.Parent:Remove() end end end)
So this is the script I made but I dont know how to make it only disappear on your screen but everybody can go get it
Use Remote Events to do this. You make a client remoteevent and connect your script to that user. Probably using this script below
Localscript in StarterGui
game.ReplicatedStorage.RemoteEvent.OnClientEvent:Connect(function(part, method) if part and method == "invis" then part.Transparency = 1 part.CanCollide = false elseif part and method == "show" then part.Transparency = 0 part.CanCollide = true end end)
Server Script in Workspace or ServerScriptService
script.Parent.Touched:Connect(function(plr) if plr and plr.Parent:FindFirstChild("Humanoid') then local player = game.Players:GetPlayerFromCharacter(hit.Parent) game.ReplicatedStorage.RemoteEvent:FireClient(player, script.Parent, "invis") end end)
make sure that the local script is in game.Players.StarterPack.StarterScripts or something like that because that way, it will only apply to the player