Hi!
I’m having an issue with replicating a bubble part across all clients. I’v made a bubble function and am using a remote event called BlowEvent to send the bubble to the server to replicate to all clients but it is not working. I’v tried to put print statements in the bounceRemote function to see if the event is even firing but it seems to not pick it up. I’m a little stuck now and don’t really understand where I’m going wrong.
(pic below)
(gif below)
--local script
local function blowBubble(pos)
if debounce then
debounce = false
--initiates bubble
local newBubble = bubble:newBubbler(pos, actualStick)
--run animation
newBubble:Animate(actualStick)
wait(cooldown)
debounce = true
-- return pos, actualStick
end
end
actualStick.Activated:Connect(function()
local pos = player.character:FindFirstChild("stick").Handle.Position
BlowEvent:FireServer(pos)
end)
BlowEvent.OnClientEvent:Connect(blowBubble)
--server script
local function bounceRemote(player, position)
for i,v in ipairs(game.Players:GetPlayers()) do
if v == player then
print(position)
replicatedStorage.Remotes.Blow:FireClient(player, position)
end
end
end
BlowEvent.OnServerEvent:Connect(bounceRemote)
thank you