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

How would I fix broken scripts with FE enabled?

Asked by 7 years ago
Edited 7 years ago

Okay so ROBLOX new rules forces to filter enable games. I did the following but broke some of my scripts and games. I tried removing filtering and without it the scripts work.

Here are few scripts that are broken

Weapons

Team Change

Let me start with the team switch issue. It's located in the startergui.

function Click(mouse) 
if script.Parent.Parent.Parent.Parent.Parent:IsInGroup(2806510) then 
script.Parent.Parent.Parent.Parent.Parent.TeamColor = BrickColor.new("Bright red") 
end 
end 

script.Parent.MouseButton1Click:connect(Click) 

Then we have the working script for weapons without FE.

( DONT BOTHER READING IT ALL IT'S JUST A COPY PASTE AND WORKS FINE WITHOUT FE )

local Players = game:GetService("Players")
local GPS = game:GetService("GamePassService")
local ServerStorage = game:GetService("ServerStorage")


local RevolverGPOld = 225096688 
local RevolverGPNew = 245915579 


local RockportTools = ServerStorage.AllTeamTools["RockportTools"]
local CitTeamTools = RockportTools["CitizenTeamTools"]
local HLSTeamTools = RockportTools["HLSTeamTools"]
local RFRTeamTools = RockportTools["RFRTeamTools"]
local RNGTeamTools = RockportTools["RNGTeamTools"]
local RDOTTeamTools = RockportTools["RDOTTeamTools"]


local TRCTools = ServerStorage.AllTeamTools["TRCTools"]
local TRCTeamTools = TRCTools["TRCTeamTools"]
local SWATTeamTools = TRCTools["SWATTeamTools"]
local ACTeamTools = TRCTools["ACTeamTools"]


local WaitTimer = 0.25


function onPlayerAdded(p)
    p.CharacterAdded:connect(function()     


        if (p.TeamColor == BrickColor.new("Bright blue")) then
            if (p:GetRankInGroup(2811607) >= 1) then
                for _,v in pairs(TRCTeamTools.OfficerUpTools:GetChildren()) do
                    wait(WaitTimer)
                    v:Clone().Parent = p.Backpack
                end
            end
            if (p:GetRankInGroup(2811607) >= 4) then
                for _,v in pairs(TRCTeamTools.SgtMrUpTools:GetChildren()) do
                    wait(WaitTimer)
                    v:Clone().Parent = p.Backpack
                end
            end
            if (p:GetRankInGroup(2811607) >= 50) then
                for _,v in pairs(TRCTeamTools.CapUpTools:GetChildren()) do
                    wait(WaitTimer)
                    v:Clone().Parent = p.Backpack
                end
            end
            if (p:GetRankInGroup(2811607) >= 200) then
                for _,v in pairs(TRCTeamTools.SuperUpTools:GetChildren()) do
                    wait(WaitTimer)
                    v:Clone().Parent = p.Backpack
                end
            end
        end

        if (p.TeamColor == BrickColor.new("Black")) then
            if (p:IsInGroup(2974178) and p:IsInGroup(2811607)) then
                for _,q in pairs(SWATTeamTools.AgentUpTools:GetChildren(1)) do
                    wait(WaitTimer)
                    q:Clone().Parent = p.Backpack
                end
            end
            if (p:IsInGroup(2974178) and p:GetRankInGroup(2811607) >= 1) then
                for _,q in pairs(SWATTeamTools.OA1UpTools:GetChildren()) do
                    wait(WaitTimer)
                    q:Clone().Parent = p.Backpack
                end
            end
            if (p:IsInGroup(2974178) and p:GetRankInGroup(2811607) >= 1) then
                for _,q in pairs(SWATTeamTools.SpecUpTools:GetChildren()) do
                    wait(WaitTimer)
                    q:Clone().Parent = p.Backpack
                end
            end
            if (p:IsInGroup(2974178) and p:GetRankInGroup(2811607) >= 1) then
                for _,q in pairs(SWATTeamTools.EUUpTools:GetChildren()) do
                    wait(WaitTimer)
                    q:Clone().Parent = p.Backpack
                end
            end
        end

        if (p.TeamColor == BrickColor.new("Medium blue")) then
            if (p:IsInGroup(193585) and p:IsInGroup(1176418)) then
                for _,h in pairs(ACTeamTools:GetChildren()) do
                    wait(WaitTimer)
                    h:Clone().Parent = p.Backpack
                end
            end
        end

        if (p.TeamColor == BrickColor.new("Medium stone grey")) then
            if (p:GetRankInGroup(2718686) >= 1) then
                for _,k in pairs(CitTeamTools:GetChildren()) do
                    wait(WaitTimer)
                    k:Clone().Parent = p.Backpack
                end
            end
        end

        if (p.TeamColor == BrickColor.new("Dark stone grey")) then
            if (p:IsInGroup(753277) and p:GetRankInGroup(1158648) >= 3) then
                for _,d in pairs(HLSTeamTools.CapSecUpTools:GetChildren()) do
                    wait(WaitTimer)
                    d:Clone().Parent = p.Backpack
                end
            end
            if (p:IsInGroup(753277) and p:GetRankInGroup(1158648) >= 8) then
                for _,d in pairs(HLSTeamTools.SpecAgUpTools:GetChildren()) do
                    wait(WaitTimer)
                    d:Clone().Parent = p.Backpack
                end
            end
        end

        if (p.TeamColor == BrickColor.new("Earth green")) then
            if (p:IsInGroup(753277) and p:IsInGroup(1167174)) then
                for _,l in pairs(RNGTeamTools.PrivUpTools:GetChildren()) do
                    wait(WaitTimer)
                    l:Clone().Parent = p.Backpack
                end
            end
            if (p:IsInGroup(753277) and p:GetRankInGroup(1167174) >= 3) then
                for _,l in pairs(RNGTeamTools.SpecUpTools:GetChildren()) do
                    wait(WaitTimer)
                    l:Clone().Parent = p.Backpack
                end
            end
            if (p:IsInGroup(753277) and p:GetRankInGroup(1167174) >= 5) then
                for _,l in pairs(RNGTeamTools.SgtUpTools:GetChildren()) do
                    wait(WaitTimer)
                    l:Clone().Parent = p.Backpack
                end
            end
            if (p:IsInGroup(753277) and p:GetRankInGroup(1167174) >= 7) then
                for _,l in pairs(RNGTeamTools.LieutUpTools:GetChildren()) do
                    wait(WaitTimer)
                    l:Clone().Parent = p.Backpack
                end
            end
            if (p:IsInGroup(753277) and p:GetRankInGroup(1167174) >= 8) then
                for _,l in pairs(RNGTeamTools.CapUpTools:GetChildren()) do
                    wait(WaitTimer)
                    l:Clone().Parent = p.Backpack
                end
            end
            if (p:IsInGroup(753277) and p:GetRankInGroup(1167174) >= 9) then
                for _,l in pairs(RNGTeamTools.MjrUpTools:GetChildren()) do
                    wait(WaitTimer)
                    l:Clone().Parent = p.Backpack
                end
            end
        end


        if (p.TeamColor == BrickColor.new("Bright red")) then
            if (p:IsInGroup(2806510) and p:GetRankInGroup(2806510) >= 1) then
                for _,r in pairs(RFRTeamTools.EMSUpTools:GetChildren()) do
                    wait(WaitTimer)
                    r:Clone().Parent = p.Backpack
                end
            end
            if (p:IsInGroup(2806510) and p:GetRankInGroup(2806510) >= 1) then
                for _,r in pairs(RFRTeamTools.FDUpTools:GetChildren()) do
                    wait(WaitTimer)
                    r:Clone().Parent = p.Backpack
                end
            end
        end

        if (p.TeamColor == BrickColor.new("Brown")) then
            if (p:IsInGroup(2724015) and p:IsInGroup(2724015)) then
                for _,t in pairs(RDOTTeamTools.Tools:GetChildren()) do
                    wait(WaitTimer)
                    t:Clone().Parent = p.Backpack
                end
            end
        end

    end)
end

for _,x in pairs(Players:GetPlayers()) do
    onPlayerAdded(x)
end

Players.PlayerAdded:connect(onPlayerAdded)
0
What? Hyperclux 65 — 7y

1 answer

Log in to vote
0
Answered by 7 years ago

Scripts that are broken due to FE being enabled is because the client is trying to replicate the the server.

In other words, any LocalScript that is trying to change something in the server will only be seen by the client.

To fix this, use RemoteEvents and RemoteFunctions.

Ad

Answer this question