Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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 

6 comments

0

They still do. Client changes just does not get replicated to the server.

0

but when i clone a script and set the parent of the script to the clients workspace the script does not run

0

then set the parent of the script to workspace IN STUDIO HOW HARD IS THAT?

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

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

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.

1 answer

✓ Accepted answer

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

5 comments

0

Thanks

0

This won't work. The stuff ahead of the while loop will not run, since you never used break in your loop.

0

Also, read https://forum.scriptinghelpers.org/topic/112/how-to-use-remoteevents-properly . Clients are perfectly capable of showing a gui.

0

My bad, was writing fast. I said the server wasn't capable of showing a GUI. Read properly.

0

wow and nobody helps me with a RemoteEvent request

This discussion is preserved as it was. New answers, comments, and votes are closed.