Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Server firing a client event causing all players Camera's to start on the same CFrame?

Asked by
M9F 94
5 years ago

So Im firing a client event for when I step on part to pop up a GUI to scroll through a series of Parts in the workspace CFrame's, which works fine but when I get two Players I have Player1 one step on the it works but lets say he goes to Camera2 then Player2 steps on the pad it will set both Player1 and Player2 CFrames to Camera1 CFrame. Any Ideas on how to fix this?

This is my script that is in the ServerScriptService

local GuiPop = game.ReplicatedStorage:WaitForChild("GuiPopUp")
    local PoppedPlayers = {}

    workspace.TestPad.Touched:Connect(function(hit)
        local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
        if plr and not PoppedPlayers[plr] then
            GuiPop:FireClient(plr)
            PoppedPlayers[plr] = true
            wait(1)
            PoppedPlayers[plr] = nil
      end
end)

This is my LocalScript in that allowed my Gui to pop up when said Client event is fired

local GuiPop = game.ReplicatedStorage:WaitForChild("GuiPopUp")

GuiPop.OnClientEvent:connect(function()
    Camera.CameraType = Enum.CameraType.Scriptable

    Camera.CFrame = workspace.Camera1.CFrame-- This is where my problem is I believe 
    script.Parent.Visible = true
    CurrentMap = 1
end)
0
Is there any script using this event at the same time? DERP9487 41 — 5y
0
It wouldn't matter unless there was another script firing the event. M9F 94 — 5y

Answer this question