--server
player.Character.Humanoid.MoveToFinished:Connect(function()
warn("FIREEE") -- this actually prints
randomPlace.Seat:Sit(player.Character.Humanoid)
receiveCookie:FireClient(player, randomPlace.Name, "Square") --but this doesnt fire
print('cutting cookie')
end)
--client
local function newCookie(randomNum, cookieType)
warn("recieved")
end
This is the squid game cookie game as I’m obviously aware. So, assuming the shape.Touched event fires, you wait until the MoveToFinished event, right? I don’t see anything wrong here, can I take a look at the full function?
local function moveLine(shape)
local line = shapes[shape]
local endShape = EndLine[shape]
print('moving line')
for _, player in pairs(line) do
player.Character.Humanoid:MoveTo(Vector3.new(endShape.Position.X,endShape.Position.Y,endShape.Position.Z - ((#shapes[shape] -1 )* spacing) ))
end
end
for _, shape in pairs(StartLine:GetChildren()) do
if shape:IsA("BasePart") then
shape.Touched:Connect(function(hit)
local player = Players:GetPlayerFromCharacter(hit.Parent)
if player then
if table.find(shapes[shape.Name],player) or table.find(cutters,player) or table.find(walking, player) then return end
local endShape = EndLine[shape.Name]
table.insert(walking, player)
controlEvent:FireClient(player, false)
player.Character.Humanoid:MoveTo(Vector3.new(endShape.Position.X,endShape.Position.Y,endShape.Position.Z - (#shapes[shape.Name] * spacing) ))
local move_connect
move_connect = player.Character.Humanoid.MoveToFinished:Connect(function()
move_connect:Disconnect()
table.insert(shapes[shape.Name],player)
walking[player] = nil
end)
end
end)
end
end
local checkLine
checkLine = RunService.Heartbeat:Connect(function()
for shape, cool in pairs(shapeCoolDown) do
if #shapes[shape] > 0 then
if cool < time() then
shapeCoolDown[shape] = time() + cooldownTime
local player = shapes[shape][1]
table.insert(cutters, player)
--table.remove(shapes[shape], 1)
shapes[shape][1] = nil
moveLine(shape)
local randomNumber = math.random(1, #container)
local randomPlace = container[randomNumber]
--table.remove(container, randomNumber)
container[randomNumber] = nil
print(randomPlace)
task.wait(1) -- geting cookie
warn('start')
player.Character.Humanoid:MoveTo(randomPlace.Seat.Position)
player.Character.Humanoid.MoveToFinished:Connect(function()
warn("FIREEE")
randomPlace.Seat:Sit(player.Character.Humanoid)
receiveCookie:FireClient(player, randomPlace.Name, "Square")
print('cutting cookie')
end)
end
end
end
end)
its the same code, but im just testing it in team test or the regular test
i can’t quite tell if its the server (thats not firing the event) or the client (thats not receiving the event)
sorry if the code is confusing to read, i didn’t add comments