My camera script didnt work

  1. What i want to do: Make the Camera set to CFrame part for my shop UI
  2. The problem: The camera is still not goes to the part CFrame when i open the shop

Script Shop:

script.Parent.Triggered:Connect(function(plr)
	local PlayerUI = plr.PlayerGui
	local GUI = PlayerUI["GUI (ResetOnSpawn)"]
	
	script.Parent.Enabled = false
	GUI.Enabled = false
	
	-- Show shop
	local GUI_NONRESETONRESPAWN = PlayerUI["GUI (NonResetOnSpawn)"]
	local Shop = GUI_NONRESETONRESPAWN.Shop
	
	local BackButton = Shop.Back
	local ShopUI = Shop.Shop
	
	BackButton.Visible = true
	ShopUI.Visible = true
	
	-- Fire Cam
	local RS = game:GetService("ReplicatedStorage")
	local Event = RS.RS_FOLDER.Event.Remote
	local SSC = Event.SetShopCam
	
	SSC:FireClient(plr, true)
	
	BackButton.MouseButton1Down:Connect(function()
		ShopUI.Visible = false
		BackButton.Visible = false
		GUI.Enabled = true
		script.Parent.Enabled = true
		SSC:FireClient(plr, false)
	end)
end)

Local Script:

local RS = game:GetService("ReplicatedStorage")
local Event = RS.RS_FOLDER.Event.Remote
local SSC = Event.SetShopCam

local Cam = workspace.CurrentCamera

SSC.OnClientEvent:Connect(function(IsShopOpened)
	if IsShopOpened then
		local ShopModel = workspace:WaitForChild("BOB SHOP")
		local ShopCamera = ShopModel:WaitForChild("ShopCam")

		Cam.CameraType = Enum.CameraType.Scriptable
		Cam.CFrame = ShopCamera.CFrame
	else
		Cam.CameraType = Enum.CameraType.Custom
	end
end)

Layout:

First check if the remote is actually being fired with print function

How do i print the fired remote?

Nvm its working now because i use Server script and change its RunContext to Client

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