FilteringEnabled can be tricky, but you can't change anything in a LocalScript without it being local. You need to use a server script, RemoteEvents, and FireServer.
Put this in a server script in ServerScriptService:
01 | local Event = Instance.new( "RemoteEvent" ) |
02 | Event.Name = "ChangeShirt" |
03 | Event.Parent = game.ReplicatedStorage |
05 | local Event 2 = Instance.new( "RemoteEvent" ) |
06 | Event 2. Name = "ChangePants" |
07 | Event 2. Parent = game.ReplicatedStorage |
09 | local Event 3 = Instance.new( "RemoteEvent" ) |
10 | Event 3. Name = "ChangeBodyColors" |
11 | Event 3. Parent = game.ReplicatedStorage |
13 | Event.OnServerEvent:connect( function (plr, id, shirt) |
15 | shirt.ShirtTemplate = id |
17 | shirt = Instance.new( "Shirt" , plr.Character) |
18 | shirt.ShirtTemplate = id |
21 | for i,v in pairs (plr.Character:GetChildren()) do |
22 | if v.ClassName = = "Accessory" then |
27 | for i,v in pairs (plr.Character:GetChildren()) do |
28 | if v.ClassName = = "Hat" then |
34 | Event 2. OnServerEvent:connect( function (plr, id, pants) |
36 | pants.PantsTemplate = id |
38 | pants = Instance.new( "Pants" , plr.Character) |
39 | pants.PantsTemplate = id |
43 | Event 3. OnServerEvent:connect( function (plr) |
45 | if plr.Character:FindFirstChild( "Body Colors" ) ~ = nil then |
46 | local BodyColors = plr.Character:FindFirstChild( "Body Colors" ) |
47 | BodyColors.RightArmColor = BrickColor.new( "Reddish brown" ) |
48 | BodyColors.LeftArmColor = BrickColor.new( "Reddish brown" ) |
49 | BodyColors.LeftLegColor = BrickColor.new( "Reddish brown" ) |
50 | BodyColors.RightLegColor = BrickColor.new( "Reddish brown" ) |
51 | BodyColors.TorsoColor = BrickColor.new( "Reddish brown" ) |
52 | BodyColors.HeadColor = BrickColor.new( "Reddish brown" ) |
54 | local c = plr.Character:FindFirstChild( "TheFlash" ) |
58 | plr.Character.Zoom:Destroy() |
59 | plr.Character.ReverseFlash:Destroy() |
60 | plr.Character.BlackFlash:Destroy() |
Now this should be your LocalScript:
01 | local player = game.Players.LocalPlayer |
02 | local Character = player.Character |
03 | if not Character or not Character.Parent then |
04 | Character = player.CharacterAdded:wait() |
07 | local ChangeShirt = game.ReplicatedStorage:WaitForChild( "ChangeShirt" ) |
08 | local ChangePants = game.ReplicatedStorage:WaitForChild( "ChangePants" ) |
09 | local ChangeColors = game.ReplicatedStorage:WaitForChild( "ChangeBodyColors" ) |
11 | script.Parent.MouseButton 1 Down:connect( function () |
12 | local Head = Character.Head |
13 | local BodyColors = Character:FindFirstChild( "Body Colors" ) |
14 | local Shirt = Character:FindFirstChild( "Shirt" ) |
15 | local Pants = Character:FindFirstChild( "Pants" ) |
28 | local ReplicatedStorage = game:GetService( "ReplicatedStorage" ) |
29 | local WallyHat = ReplicatedStorage.Remote.WallyHat |
31 | ChangeColors:FireServer() |
32 | local t = game:GetService( 'UserInputService' ).TouchEnabled |
34 | player.PlayerGui.Teleport.Minus.Visible = true |
35 | player.PlayerGui.Teleport.Plus.Visible = true |
36 | player.PlayerGui.Teleport.Walkspeed.Visible = true |
38 | player.PlayerGui.ControlHUD.Frame.Visible = true |
39 | script.Parent.Parent.Parent.Parent:Destroy() |
This should all (in theory) work as you want, if anything goes wrong feel free to comment and I'll try to respond as quick as possible.