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

ModuleScript not working properly. Explanation below ?

Asked by 5 years ago

So i have two parts in workspace each having boolean "Var" variable and scripts into them Then i have a module script in serverscriptservice which is required from both of the scripts placed in parts

ModuleScript:

local Module = {}

function Module.Func(val)
    local Part = val
    local Var = Part.Var
    Var.Changed:Connect(function(Newval)
      if Newval == false then 
         Part.Transparency = 1
      end
    end)
end

return Module

Script:

local Part = script.Parent
local Module = require(game.ServerScriptService.ModuleScript)
Module.Func(Part)

So when i change Part1's Variable value to false, Part2 goes transparent instead of Part1, What can be causing it?

0
is there a script in part2? there's no reason that the part2 would randomly because transparent User#22604 1 — 5y

Answer this question