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

GUI POPUP On Filtering Enabled?

Asked by 5 years ago

So.. how?.. I already Try this I write this on mobile so if there was wrong on the script like the caps lock don't write about it

local frame = script.parent

Game.Players.PlayerAdded:Connect(function() Print("Work") Wait(100) frame.visible = true end)

Idk the different for local script and script well tell me :)

So.. I tested this script it won't work in local script Then I try on script still not working any idea??

1 answer

Log in to vote
1
Answered by
LeadRDRK 437 Moderation Voter
5 years ago
Edited 5 years ago

Script and LocalScript are almost the same, but there are some difference between in those two. Things that are done in normal Script is server-sided, therefore replicate to all clients. LocalScripts will be processed only on the client, meaning that everything that is done in a LocalScript will only be visible for the client that processed it and it will not replicate to other clients (although it will still replicate to other clients if FilteringEnabled is turned off) and will not be able to interact other stuffs made other clients (they can still interact with the server). LocalScripts also cannot use server-sided services, functions, etc.

Therefore, your scripts doesn't work for a number of reasons:

LocalScript

Using the PlayerAdded event in a LocalScript cannot generally be used, because:

-It would be only fired for players that joins the server later, not firing for the current player

-As mentioned earlier, a LocalScript cannot interact other stuff created by other clients, so even when the event is fired for the next player that joins in, the gui wouldn't appear for that player. It simply cannot access the gui.

Script

Using the PlayerAdded event in a Script is generally fine, BUT, a server can't access a client's guis, therefore it's not possible to use a server/normal script

So only using a LocalScript we would be able to control our gui.

The fix is fairly simple. You do not need to use the PlayerAdded event, rather directly enabling the gui right at the start:

--LocalScript inside of the gui
local frame = script.Parent
wait(100)
frame.Visible = true
-- this will enable the gui after 100 seconds, as your original script included the wait

So that's all. If this worked for you, please click the Answer button below and upvote the answer.

lead6dead2.

Ad

Answer this question