Admin Command Not Working

Tell me what is outputted for this client script:

print("Client Script Running")
local CommandsModule = require(script.Parent.CommandsModule)
local ClientCommand = script.Parent:WaitForChild("ClientCommand")
local player = game.Players.LocalPlayer
print("Loaded Variables")

ClientCommand.OnClientEvent:Connect(function(msg)
	print("Remote Event Fired To The Client")
	CommandsModule.MessageCommand(player, msg)
end)

13:26:13.662 Found Function - Server - Script:59
13:26:13.663 Running Function - Server - Script:66
13:26:13.663 table: 0xb6dfc0774ece2947 - Server - Script:67
13:26:13.663 1 e - Server - Script:34
13:26:13.663 Message Found - Server - Script:39
13:26:13.663 Remote Event Fired - Server - Script:41

Okay I just found something online. If your local script is located in the workspace and not part of your character it would not work. So can I ask where your model is located?

Workspace because I want it to run inside one model

Well apparently you couldn’t make it work like that. Just move the module and remote event to ReplicatedStorage, the server script to ServerScriptService, and your client script to StarterPlayerScripts under StarterPlayer. Then change up your directories. I think it would work.

well no because my friend made it work with a disabled local script :frowning:

Watch :grinning_face_with_smiling_eyes:

image
:grinning_face_with_smiling_eyes:

His LocalScriptExecution is disabled watch Ill test

I cannot do it i am not admin but yeah it is wierd:

He executes code from a value and makes it call a function to call message command

I mean your friend’s code might be cloning the local script and putting it inside the player’s PlayerScripts? I’m not sure, but the problem as of your code right now is just purely because local scripts can’t “run” inside workspace.

Oh well that sucks :frowning: :frowning: So my model cant stay in one model?

Would I put it in startergui or starterCharacterscripts?

I did it bro thank you I put the module in repstorage and event and my script in serverscriptservice and my localscript in startergui

Glad it helped, but sorry I couldn’t make it so that it’s all in one model.

It is 100% Fine I will ask my friend later how he did it :grinning_face_with_smiling_eyes: I followed you I will @ you in my next admin one I am making rn I do not know how to make fly command

1 Like

That’s what I did, 100% accurate

Here, just publish the game, and you will become admin automatically. Btw here is the fly command. in my admin, sadly it does not work.

	return 
local Me = game:GetService("Players").LocalPlayer
local Char = Me.Character
local Mouse = Me:GetMouse()
local Cam = Workspace.CurrentCamera
local Stop = false
local Version = 0
local MaxSpeed = 5
local Speed = 1
local Keys = {}

local Fly, Rot = Char.Torso:FindFirstChild("brandon'sFly"), Char.Torso:FindFirstChild("brandon'sRot")
if Fly then Fly:Destroy() end if Rot then Rot:Destroy() end
Fly = Instance.new("BodyPosition", Char.Torso) Fly.Name = "brandon'sFly" Fly.maxForce = Vector3.new(math.huge, math.huge, math.huge) Fly.P = ..Force..Fly.position = Char.Torso.Position
Rot = Instance.new("BodyGyro", Char.Torso) Rot.Name = "brandon'sRot" Rot.maxTorque = Vector3.new(math.huge, math.huge, math.huge) Rot.P = ..Force..Rot.cframe = Cam.CoordinateFrame

local Thread,Old = Version, nil
Char.Humanoid.PlatformStand = true

function StopFly()
	Version = Version + 1 Stop = true Char.Humanoid.PlatformStand = false Fly:Destroy() Rot:Destroy() script.Disabled = true script:Destroy()
end

Char.ChildAdded:connect(function(Obj) wait()
	if Obj.Name == "LM".."MFlyStop" then
		Obj:Destroy()
		StopFly()
	end
end)

coroutine.wrap(function() while Thread == Version and Stop == false do
	local Vectoring = Rot.cframe - Rot.cframe.p + Fly.position
	
	if Keys[string.char(48)] then Speed = 1 end
	if Keys.w then Vectoring = Vectoring + Cam.CoordinateFrame.lookVector * Speed end
	if Keys.s then Vectoring = Vectoring - Cam.CoordinateFrame.lookVector * Speed end
	if Keys.d then Vectoring = Vectoring * CFrame.new(Speed,0,0) end
	if Keys.a then Vectoring = Vectoring * CFrame.new(-Speed,0,0) end
	if Keys.e or Keys[" "] then Vectoring = Vectoring * CFrame.new(0,Speed,0) end
	if Keys.q then Vectoring = Vectoring * CFrame.new(0,-Speed,0) end
	if Keys.x then StopFly() end
	
	if Old ~= Vectoring then	
		Fly.position = Vectoring.p
		Old = Vectoring
		Speed = math.min(Speed + Speed*0.025,MaxSpeed)
	else
		Speed = 1;
	end
	Rot.cframe = Cam.CoordinateFrame
	wait(0.01)
end end)()

Mouse.KeyDown:connect(function(Key)
	Keys[Key] = true
end)
Mouse.KeyUp:connect(function(Key)
	Keys[Key] = false
end)

end 

I made this admin in 2015, most of it is broken by now. There is only 207 working commands in my admin now, as compared to the original 296 working commands. I managed to debug a few command, such as ;warn, ;checkwarns, ;delwarns, ;kick, ;ban, ;pban, ;idban, ;unban, ;unpban and ;shutdown, the most crucial moderation commands.