In my game when you interact with the proximity prompt it changes your camera cframe but when we do it with multiple people it changes all of their cameras. How do we make it only affect that one person?
(Normal Script)
local ProximityPrompt = script.Parent.ProximityPrompt
local CamScene1 = game.ReplicatedStorage.CamScene1
local ReturnCam = game.ReplicatedStorage.ReturnCam
local Bridge = game.ReplicatedStorage.Bridge
local Cams = script.Parent.Parent.Parent.Cams
function StartConfigGui(player)
local BottomMenu = player.PlayerGui:WaitForChild("BottomMenu")
local Stat = player.PlayerGui:WaitForChild("Stats")
local WorkshopGui = player.PlayerGui:WaitForChild("WorkshopGui")
local WorkShopButtons = player.PlayerGui:WaitForChild("WorkshopButtons")
BottomMenu.Enabled = false
Stat.Enabled = false
WorkShopButtons.Enabled = true
end
function EndConfigGui(player)
local BottomMenu = player.PlayerGui:WaitForChild("BottomMenu")
local Stat = player.PlayerGui:WaitForChild("Stats")
local WorkshopGui = player.PlayerGui:WaitForChild("WorkshopGui")
local WorkShopButtons = player.PlayerGui:WaitForChild("WorkshopButtons")
BottomMenu.Enabled = true
Stat.Enabled = true
WorkShopButtons.Enabled = false
end
ProximityPrompt.Triggered:Connect(function(player)
CamScene1:FireAllClients(Cams.Cam1.CFrame, player)
StartConfigGui(player)
script.Parent.Transparency = 1
script.Parent.Transparency = 0.75
end)
Bridge.OnServerEvent:Connect(function(player)
local WorkshopGui = player.PlayerGui:WaitForChild("WorkshopGui")
ReturnCam:FireAllClients(player)
EndConfigGui(player)
WorkshopGui.Enabled = false
end)
It calls a camera move remote event
(Local Script)
local Camera = game.Workspace.Camera
local CamScene1 = game.ReplicatedStorage.CamScene1
local ReturnCam = game.ReplicatedStorage.ReturnCam
local TweenService = game:GetService("TweenService")
local Info = TweenInfo.new(1, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut, 0, false, 0)
local ProximityPrompt = game.Workspace.PCTEST.PC.Cover.ProximityPrompt
CamScene1.OnClientEvent:Connect(function(CamCFrame, player)
Camera.CameraType = Enum.CameraType.Scriptable
ProximityPrompt.Enabled = false
TweenService:Create(Camera, Info, {CFrame = CamCFrame}):Play()
game.Workspace[player.Name].Humanoid.WalkSpeed = 0
for i,v in pairs(player.Character:GetDescendants()) do
if v:IsA("BasePart") or v:IsA("Decal") then
v.Transparency = 1
end
end
end)
ReturnCam.OnClientEvent:Connect(function(player)
Camera.CameraType = Enum.CameraType.Custom
ProximityPrompt.Enabled = true
game.Workspace[player.Name].Humanoid.WalkSpeed = 16
for i,v in pairs(player.Character:GetDescendants()) do
if v:IsA("BasePart") or v:IsA("Decal") then
v.Transparency = 0
end
end
game.Workspace[player.Name].HumanoidRootPart.Transparency = 1
end)