Hey everyone, I am attempting to reduce exploiters in my game by using filtering enabled, one issue I have found is that startergui wont copy over to playergui (I assume the same happens with starterpack although I can think of an easy workaround for that). I attempted to do this:
player.CharacterAdded:connect(function(character) for i,v in pairs(game:GetService("StarterGui"):GetChildren()) do v:clone().Parent = player:WaitForChild("PlayerGui") end end)
with no success, any ideas?
I had the very same problem so I am using this script which fixes the problem:- This script is in ServerScriptService and my gui is in the workspace
function onHumanoidDied(property, plr) plrGui = plr.PlayerGui:FindFirstChild("ScreenGui") if plr~= nil and plrGui~=nil then plr.PlayerGui.ScreenGui:Destroy() end end function onPlayerRespawn(property, plr) while plr and plr.Parent do if plr.Character then break end wait(1) end if not (plr and plr.Parent) then return end wait(1) if game.Workspace.FilteringEnabled then game.Workspace.FilteringEnabled = false wait(1) Workspace.ScreenGui:Clone().Parent = plr.PlayerGui game.Workspace.FilteringEnabled = true else game.Workspace.FilteringEnabled = true end end function onPlayerEntered(plr) while plr and plr.Parent do if plr.Character then break end wait(1) end if not (plr and plr.Parent) then return end wait(1) Workspace.ScreenGui:Clone().Parent = plr.PlayerGui plr.CharacterRemoving:connect(function(property) onHumanoidDied(property, plr) end) plr.CharacterAdded:connect(function(property) onPlayerRespawn(property, plr) end) end game.Players.PlayerAdded:connect(onPlayerEntered)
Locked by adark, Shawnyg, and SanityMan
This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.
Why was this question closed?