Hi all,
I have a server script in my game that when a proximity prompt is triggered (that is detected using ProximityPromptService as there is an unspecified amount of them) it triggers an event which their client side should pick up which will load their machine. The issue is, is on some clients that can take upwards of 10 minutes to happen. The code doesn’t send anything major so I am a bit stuck as to how to reduce it as on my computer it loads within a second.
(Left unnecessary code out)
Server Code
function onPromptTriggered(promptObject, player)
if not player.Checked.Value then
core.To:FireClient(player, "SCI", promptObject)
player.Character.HumanoidRootPart.CFrame = promptObject.Parent.Parent.PlrCFrame.CFrame
player.Character.HumanoidRootPart.Anchored = true
end
end
Client Code
core.To.OnClientEvent:Connect(function(task, ...)
if task == "SCI" then
local args = {...}
local loc = args[1].Parent.Parent
local gui = core.CheckInUI:Clone()
gui.Parent = Player.PlayerGui
loc.screen.Decal.Transparency = 1
gui.Adornee = loc.screen
game.Workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable
TweenInstance(game.Workspace.CurrentCamera,0.7,{CFrame = loc.camPart.CFrame})
end
end)
Any suggestions would be greatly appreciated!