Instance Not Being Created

new script

local Module = require(script.Parent:WaitForChild("ServerAdmin"):WaitForChild("ModuleScript"))

game.Players.PlayerAdded:Connect(function(player)
	print("player joined")
	local Warning = Instance.new("IntValue")
	Warning.Name = "Warnings"
	--Warning.Value = Module.LoadWarnings(player)
	Warning.Parent = player
	print("Parented")
end)

game.Players.PlayerRemoving:Connect(function(player)
	Module.SaveWarnings(player)
end)

nothing in output

instead of game.Players, use game:GetService("Players")

1 Like

It’s likely that you are infinitely waiting for ServerAdmin or ModuleScript

2 Likes

There would be an infinite yield warning, if that was the case.

2 Likes

I don’t think, if you stop the test immediately, most errors will not come out.

1 Like

nothing in output

Thanks for everyone who tried to help

Put a print() below the require(), if the wait is really infinite, it won’t print.

1 Like

Ya It doesn’t print anything in the output

You should move the module to ServerStorage because as the name says, it is for scripts only.

1 Like

I moved the module scripts
And I found the problem
without requiring the module:
Screenshot_24
with requiring:
Screenshot_23

It is because of the infinite wait, if you want to confirm it, inside the require(), but in the end, put a comma and 1, the value will have nil.

local Module = require(script.Parent:WaitForChild("ServerAdmin"):WaitForChild("ModuleScript"),1)

Leave the folder in ServerStorage.

local ServerStorage = game:GetService("ServerStorage")
local Module = require(ServerStorage:WaitForChild("ServerAdmin"):WaitForChild("ModuleScript"))
1 Like

There are better values: FastValue a replacement for Value Instances that is better than Remotes and Bindables