Camera Chat Commands - Source Code

Want to join our community or have any questions about scripting support, sign up!

Local Script


local player = game.Players.LocalPlayer
local camera = game.Workspace.Camera



wait(2)

game.ReplicatedStorage.Cutscene.OnClientEvent:Connect(function(Start)
	if Start == true then 
		camera.CameraType = "Scriptable"
		camera.CFrame = game.Workspace.Cam.CFrame
	else
		camera.CameraSubject = player.Character.Humanoid
		camera.CameraType = "Custom"
		camera.CFrame = player.Character.Head.CFrame
	end
end)


Server Script
local GroupId = 7
local Minrak = 0

local prefix = "!"
local command = "cam"
local CameraOnline = false

game.Players.PlayerAdded:Connect(function(Player)
	if Player:GetRankInGroup(GroupId) >= Minrak then 
		Player.Chatted:Connect(function(Msg)
			if Msg == prefix..command then
				if CameraOnline == false then 
					game.ReplicatedStorage.Cutscene:FireAllClients(true)
					CameraOnline = true
				else
					game.ReplicatedStorage.Cutscene:FireAllClients(false)
					CameraOnline = false
				end
			end
		end)
	end
end)



1 Like

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