My script is trying to fire a event from the server to the client to know when to tween a UI, but it is looking for a player arg, but I don’t have one nor need one for my script, is there any work around?
Part of my server sided code:
local AlivePlrs = {}
for i, player in pairs(game.Players:GetPlayers()) do
if player then
table.insert(AlivePlrs, player)
end
end
wait(3)
local CurrentMaps = Maps:GetChildren()
local ChosenMap = CurrentMaps[math.random(1,#CurrentMaps)]
TweenEvent:FireClient()
wait()
Status.Value = "Starting the round..."
Client code:
local Status = game.ReplicatedStorage:WaitForChild("Status")
local TweenEvent = game.ReplicatedStorage.RemoteEvents:WaitForChild("Tween")
local MainUI = script.Parent.Parent
script.Parent.Text = Status.Value
Status.Changed:Connect(function()
script.Parent.Text = Status.Value
end)
TweenEvent.OnClientEvent:Connect(function()
MainUI:TweenSizeAndPosition(UDim2.new(1,0, 1,0),UDim2.new(0,0, 0,0))
if Status.Value == "Setting up the round" then
MainUI:TweenSizeAndPosition(UDim2.new(0.462,0, 0.083,0),UDim2.new(0.269,0, 0.027,0))
end
end)