Cmdr help - view command

@evaera’s cmdr

How can I make a command on cmdr that makes the executor view the player they selected? (with cmdr obviously)

I’m lost, I’ll attached screenshots below

image

Here is the “view” module:

return {
	Name = "view";
	Aliases = {};
	Description = "View a player";
	Group = "DefaultAdmin";
	Args = {
		{
			Type = "player";
			Name = "Player";
			Description = "The player you want to view";
		},
	};
}

And the “viewServer” module:

return function (_, players)
	
	
	return ("Viewing player")
end

As you can see, I’m lost with the viewServer module, I have no idea where to start

Thanks for your help

I’ll test it, if this works, I’m actually dumb af

It doesn’t work sadly, I think it is because it doesn’t define the executor

Do you have any idea how to do that?

I found this in the document but I’m not quite sure how to implement it into the viewServer

Link below

Still needing help on this, I’ve been trying for the past 10 mins to get this to work

return {
	Name = "view";
	Aliases = {};
	Description = "View a player";
	Group = "DefaultAdmin";
	Args = {
		{
			Type = "player";
			Name = "Player";
			Description = "The player you want to view";
		},
	};
ClientRun = function(context, player)
workspace.CurrentCamera.CameraSubject = player.Character.HumanoidRootPart
return (Viewing player)
end
}

That looks like it functions, I’ll test it and fork it if I need

If I get it working I’ll mark your reply as the solution

1 Like

Alright so I got it working but the thing is I need the command unview aswell

Here’s what I’ve got so far

return {
	Name = "unview";
	Aliases = {};
	Description = "View yourself";
	Group = "DefaultAdmin";
	Args = {
	};
	
	ClientRun = function(context, player)
		workspace.CurrentCamera.CameraSubject = ???
		return ("Viewing yourself")
	end
}
function(context, ...)
workspace.CurrentCamera.CameraSubject = context.Executor.Character.HumanoidRootPart

Fill in the gaps.

Okay so I won’t make the unview command since you can just do view . to view yourself, but it does this strange thing with the camera which makes your camera behind their avatar and not snappy

Is there a reason why?

Ask for a video if you need it

Set FOV CurrentCamera.FieldOfView back and set CameraType to Custom.

Changing the CameraSubject to Humanoid seems to fix this, I’ll do some final tests to check if it works and mark your reply as the solution if I fix it

Alright so I fixed it by setting the CameraType to Custom INSIDE THE SCRIPT!

Thanks for your help @M_etrics

Final code for future readers
return {
	Name = "view";
	Aliases = {"look"};
	Description = "View a player";
	Group = "DefaultAdmin";
	Args = {
		{
			Type = "player";
			Name = "Player";
			Description = "The player you want to view";
		},
	};
	
	ClientRun = function(context, player)
		workspace.CurrentCamera.CameraSubject = player.Character.Humanoid
		workspace.CurrentCamera.CameraType = Enum.CameraType.Custom
		return ("Viewing player")
	end
}
1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.