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

My module script won't work and i don't know what to do! Could anyone help me? (Admin Detector)

I've been trying to make an admin detector that would get a GUI out of server storage and once an admin joins it would give it to him. Tho i have a problem here wich i can't tell. It's surely because of pathway of Clone.Parent but I can't understand where i need to put it since it will work only running.

--Module Script
local module = {
	"1378234206"
}
return module



--Normal script
local GUI = game.ServerStorage.CMDR
local PermsTable = require(script.Parent:WaitForChild("Permissions"))

game.Players.PlayerAdded:Connect(function(player)
	if table.find(PermsTable, tostring(player.UserId)) then
		local Clone = GUI:Clone()
		Clone.Parent = game.Players.module.PlayerGui
		print("Admin Detected!") 
	else
		print("Oops...Something went wrong!")
	end
end

3 comments

0

Try relocating it to ReplicatedStorage and see if it makes a difference. Odds are there are LocalScripts that are refusing to run, but you never exactly specified your problem.

0

Replace line 16 with: Clone.Parent = player:WaitForChild("PlayerGui"); PlayerGui is container of Player where all of the GUI stored is shown to the player: https://developer.roblox.com/en-us/api-reference/class/PlayerGui

0

Still doesn't work.

1 answer

Idk the answer to this question but if you're trying to make admin then.. Make a table and set the admins, and then make another table which are the commands. Put functions inside the commandtable, and there is your admin commands set.

I hope this helped

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