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

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

Asked by
yut640 91
7 years ago

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

Log in to vote
1
Answered by
ikiled 75 Donator
7 years ago

Make your game filtering enabled for that to work.

Ad

Answer this question