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

How to make parts disappear locally???

Asked by 5 years ago

I want to make every player with the gamepass "No Advertisements" to stop seeing the AdPanel Part (Not everyone, only the people with the gamepass "No advertisements") Thank you

Here is my code:

nag = true

local part = script.Parent.Adpanel -- Dont change this, Thank you!
local player = game.Players.LocalPlayer -- Please dont change this, Thank you!

if nag == true then
game.Players.PlayerAdded:connect(function(player)
    if game:GetService("GamePassService"):PlayerHasPass(player, id) then 
       --What do i do Here?
    else
       print("A New Player has joined and he/she does not have the anti ads gamepass")
    end
end)
else
print("NAG has been Disabled, to enable it, go to the NAG Settings and set the nag option to true (It is True by default)")
end
1
If FilteringEnabled is on, using part:Destroy() should be enough, I think. ScrewDeath 153 — 5y
1
Turn on FE first OBenjOne 190 — 5y
0
You need to enable Filtering by going to the workspace properties and checking Filtering Enabled that should make client side changes stay on the client side. To read more go to this http://wiki.roblox.com/index.php?title=API:Class/Workspace/FilteringEnabled The script that is disabling the ads should be in local script, in some where it can run, like StarterGui yoavstr 52 — 5y

1 answer

Log in to vote
1
Answered by 5 years ago

Hello,

What you can do is just enable filtering enabled (go to Workspace and tick the FilteringEnabled box) and then just use part:Remove() it is going to remove it locally.

For more information visit the wiki.

~Frag

Ad

Answer this question