Attept to index function with 'OnServerEvent'

I have no clue why this is happening, its never happened before.


local Decompose = game.ReplicatedStorage.Decompose
local GetOut = game.ReplicatedStorage.Undecompose

local function Decompose(player)
	local Char = game.Workspace:WaitForChild(player.Name)
	Char.HumanoidRootPart.Anchored =true
end

local function GetOut(player)
	local Char = game.Workspace:WaitForChild(player.Name)

end


GetOut.OnServerEvent:Connect(GetOut)

Decompose.OnServerEvent:Connect(Decompose)

rename your variables to end with Event so lua doesn’t get confused. right now it’s doing the actual functions

1 Like

You named your functions and variables the same, as a result Lua can get confused.

Re-name either your functions or your variables.