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

Local script affecting other players?

I have a script that is supposed to make certain bricks appear for the player when they touch a brick, it works fine except for the fact that other players can also see it when they're not supposed to.

This is my code:

local CrashBlocks = game.Workspace.crash:GetChildren()

local function onTouch(hit)
	for i, v in pairs(CrashBlocks)do
		v.Transparency = 0
		v.CanCollide = true
	end
	end
game.Workspace.speed1.Touched:Connect(onTouch)


local debounce = false

local sound = game.Workspace.soundeffects.Explosion

game.Workspace.speed1.Touched:Connect(function(hit)
	
	if not debounce then
		
		debounce = true
		
		sound:Play()
		
		wait(3)
		
		debounce = false
	end
end)


My understanding of local scripts is that they will only appear on the players client, apologies if I'm missing something super obvious here, I'm really new.

2 comments

0

Do fireclient()

0

If you don't understand , take a look at remote events

1 answer

try a remote event. make a script where you put the function for when the remote event is called onther script to do what ever you want when the remove event is fired on the the client.

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