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

Why is this local script not acting like a local script? ;-;

K so I have a script right yep of course I do why would I be here if I didnt...

Anyway. This tool script thing is a local script and it causes things to appear when you hold it right and yeah it does that thing. But if another player holds the item, all players see the stuff that should be invisible. How do I make it so it doesn't do that? I want it to just be the player holding the item that is the one that can see the stuff. It's irritating like ugh kms.

local tool = script.Parent
local parts = workspace.Invis:GetChildren()

local function onEquip()
    for i,v in pairs(parts) do
        v.Transparency = 0.5
    end
end

local function onUnequip()
    for i,v in pairs(parts) do
        v.Transparency = 1
    end
end

 
local function onActivate()
	    for i,v in pairs(parts) do
        v.CanCollide = true
    end
end
 
local function onDeactivate()
	    for i,v in pairs(parts) do
        v.CanCollide = false
    end
 
end
 
tool.Equipped:connect(onEquip)
tool.Unequipped:connect(onUnequip)
tool.Activated:connect(onActivate)
tool.Deactivated:connect(onDeactivate)

1 answer

✓ Accepted answer

Make your game filtering enabled for that to work.

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