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

(Read the comments btw) Filtering Enabled will not take effect?

Asked by 4 years ago
Edited 4 years ago

These are in local scripts, in either StarterPlayerScripts or StarterGui

I've published this game many times over itself as a new place. I've disabled and re-enabled filtering enabling so many times and published, and I have some scripts that show that this is the case. I know with filtering enabled on, client side & server side things work differently, and for my case this particular script changes the lighting and sound for a each individual player. However when somebody 'triggers' the lighting and sound, it plays on the server, and everyone can hear it. I tried using remote events, and it hasn't changed. Oh yeah the lighting is also server sided for some reason. If somebody could let me know what's poppin I would appreciate it :D

if hit.Parent:FindFirstChild("Humanoid") then
        for i = 1,1 do
            local partsInRegion = workspace:FindPartsInRegion3(region, nil, 500)
            for i, part in pairs(partsInRegion) do
                if part.Parent:FindFirstChild("Humanoid") ~= nil then
                    found = true
                    end

                if found == true then
                    touched = true
                    local Players = game:GetService("Players")
                    if debounce == false then
                    debounce = true
                        remote:FireServer()
                        game.Lighting.Brightness = .7
                        game.Lighting.Blur.Size = 7
                        game.Lighting.FogEnd = 500
                        game.Lighting.FogStart = 0
                        game.Lighting.FogColor = Color3.fromRGB(255, 255, 255)
0
Are you sure you are using only LocalScripts? Also please try providing a Scriptcode. ShaShxa 105 — 4y
0
You said you tried using RemoteEvents to try making it client-sided? AntoninFearless 622 — 4y
0
I will update this with some code soon. Also, yes I did try using remote events to attempt making it client sided, but no luck. TheOfficiaIZai 8 — 4y
0
so uh. i use remote events to talk back to the client. i would just have to define the player through a function first. Event:FireClient(Player) TheOfficiaIZai 8 — 4y
View all comments (8 more)
0
also all of the lighting changes take place in a local script TheOfficiaIZai 8 — 4y
0
i just use the server scripts to replicate a sound TheOfficiaIZai 8 — 4y
0
and then it fires it back to the local script which will then find the sound in the startergui / starterplayerscripts and play it TheOfficiaIZai 8 — 4y
0
the thing is i only had to do all that because a simple local script playing sound to the local player didnt work. like what idk TheOfficiaIZai 8 — 4y
0
woopsy, ok will look into it AntoninFearless 622 — 4y
0
is that a localscript? AntoninFearless 622 — 4y
0
yeah, that code block is from a local script TheOfficiaIZai 8 — 4y
0
ok im gonna put an answer and tell me if it works  AntoninFearless 622 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

Your LocalScript is detecting a touch from any player that touches it, so basically you want to see if what hit it is the local player

I didn't test this however but I'm pretty sure this would work:

local player = game.Players.LocalPlayer

if hit.Parent.Name == player.Name then
        for i = 1,1 do
            local partsInRegion = workspace:FindPartsInRegion3(region, nil, 500)
            for i, part in pairs(partsInRegion) do
                if part.Parent:FindFirstChild("Humanoid") ~= nil then
                    found = true
                    end

                if found == true then
                    touched = true
                    local Players = game:GetService("Players")
                    if debounce == false then
                    debounce = true
                        remote:FireServer()
                        game.Lighting.Brightness = .7
                        game.Lighting.Blur.Size = 7
                        game.Lighting.FogEnd = 500
                        game.Lighting.FogStart = 0
                        game.Lighting.FogColor = Color3.fromRGB(255, 255, 255)
0
I'll test this soon, thank you for your help :) Actually this might be it. I'll accept it in a bit. TheOfficiaIZai 8 — 4y
Ad

Answer this question