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

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

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)

12 comments

0

Are you sure you are using only LocalScripts? Also please try providing a Scriptcode.

0

You said you tried using RemoteEvents to try making it client-sided?

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.

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)

0

also all of the lighting changes take place in a local script

0

i just use the server scripts to replicate a sound

0

and then it fires it back to the local script which will then find the sound in the startergui / starterplayerscripts and play it

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

0

woopsy, ok will look into it

0

is that a localscript?

0

yeah, that code block is from a local script

0

ok im gonna put an answer and tell me if it works 

1 answer

✓ Accepted answer

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)

1 comment

0

I'll test this soon, thank you for your help :) Actually this might be it. I'll accept it in a bit.

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