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

How to have filtering enabled on and still have scripts work inside the client?

Asked by 6 years ago

So there is a Local Script with a script inside of it. Then i want to clone the script inside the local script and put the clone inside the workspace, but when i do that, the clone script does not run. But it is in the workspace and is not disabled. I want filtering enabled on in case the game is hacked. so is there any way for me to keep it on and just change the way i am doing this. That is my situation but how do get filtering enabled on and still have scripts work inside the client?

LocalScript inside gui:

local s = script.Script:Clone()
    s.Parent = game.Workspace
    s.Disabled = false

Script:

print("Runs") -- this is to make sure it works but it doesn't work
local Player = game.Players:FindFirstChild(script.Parent.Value.Value)
Player.PlayerGui.MurderScreen.Enabled = false 
0
They still do. Client changes just does not get replicated to the server. hiimgoodpack 2009 — 6y
0
but when i clone a script and set the parent of the script to the clients workspace the script does not run justintubba123 6 — 6y
0
then set the parent of the script to workspace IN STUDIO HOW HARD IS THAT? hiimgoodpack 2009 — 6y
0
That Script you are using seems to do something that should only affect the client anyway - the server cannot see inside PlayerGui also. Just integrate that code into your LocalScript. Also hiim, you need to chill lol TheDeadlyPanther 2460 — 6y
View all comments (2 more)
0
The main script in the game stops until the MurderScreen's enabled is false and the main script only looks at the server cause it is a normal script so i need to get a script inside the server. When i was testing it i moved the script's parent to the server and it worked so i just need a way of doing that with scripts justintubba123 6 — 6y
0
Well the problem is the server can't actually look inside PlayerGui. I recommend you have an external value in the player or you use RemoteEvents to communicate with the server. TheDeadlyPanther 2460 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

Here's an example of communicating with the server to start the game.


Server script:

local Event = game.ReplicatedStorage:WaitForChild("ReadyEvent") -->> RemoteEvent
local ReadyPlayers = {}

Event.OnServerEvent:Connect(function(Player) -->> Recieve affirmation
    local InTable = false
    for _,_Player in pairs (ReadyPlayers) do -->> Check if player is already ready
        if _Player == Player then
            InTable = true
            break
        end
    end
    if not InTable then
        table.insert(ReadyPlayers,Player)
    end
end)

while true do
    ReadyPlayers = {} -->> Reset ready players
    Event:FireAllClients() -->> Send request to "ready up"
    repeat wait() until #ReadyPlayers >= game.Players.NumPlayers -->> Check if the number of ready players is the same as the number of players in game
    -->> do the game
    wait()
end

Local script:

local Event = game.ReplicatedStorage:WaitForChild("ReadyEvent")

Event.OnClientEvent:Connect(function() -->> When a request to "ready up" is recieved
    Event:FireServer() -->> Send affirmation
end)

Hope I helped!

~TDP

0
Thanks justintubba123 6 — 6y
0
This won't work. The stuff ahead of the while loop will not run, since you never used break in your loop. hiimgoodpack 2009 — 6y
0
Also, read https://forum.scriptinghelpers.org/topic/112/how-to-use-remoteevents-properly . Clients are perfectly capable of showing a gui. hiimgoodpack 2009 — 6y
0
My bad, was writing fast. I said the *server* wasn't capable of showing a GUI. Read properly. TheDeadlyPanther 2460 — 6y
0
wow and nobody helps me with a RemoteEvent request Lolamtic 63 — 6y
Ad

Answer this question