Hi all,
So I have an event that when it’s fired from the server and received by the client, it changes the current cameras CFrame. However, the event fires but is never received by the client. I looked on the wiki about RemoteEvents and couldn’t find anything that would help me. The weird thing is that nothing no errors show up in console. I’d really appreciate if someone could tell me what I’ve done wrong, thanks in advance
.
Server Script:
local camPart = script.Parent.camPart
local mainPart = script.Parent.MainPart
guiPart.SurfaceGui.Frame.ImageButton.MouseButton1Click:Connect(function()
if canClick == true then
game:GetService("ReplicatedStorage").Events.guiClicked:FireAllClients()
print("Fired")
end
end)
Client Script:
function buttonClicked()
print("Recieved")
for i, door in pairs(doors:GetChildren()) do
camera.CameraType = Enum.CameraType.Scriptable
camera.CFrame = door.camPart.CFrame
end
end
game:GetService("ReplicatedStorage").Events.guiClicked.OnClientEvent:Connect(buttonClicked)