You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
I want to emit a Particle when the player lands/hits the ground. Additionally, I want the particles to also be positioned in between the player’s “RightFoot” and “LeftFoot” . -
What is the issue? Include screenshots / videos if possible!
The problem is that for some reason the particles are positioned differently on each client.
Here is a visual representation of what the issue is, on the Right you have Client #1, and on the Left you have Client #2; where the main issue occurs:
https://gyazo.com/a68adb9802ca01fd0c3c78689601facb -
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I can’t wrap my head around it. I believe that this issue occurs because each client run at a different speed. I tried putting a “wait()” so that the script waits till the player hits the ground. Still no results. I also tried using a RemoteEvent!, all kinds of RemoteEvents that I think would work. From Client → Server, Client → Server → Client, and still no results. If you looked closely you’ll see that I used an attachment to position the particles. I also tried of using another method of just sending over to the server the position of where the player’s foot is located when he touched the ground and tried creating a part and position it where that interaction happened, and it still didn’t work. I also tried using “:Lerp” and let me just add I’ve never used lerp till now, but I’m pretty sure I used it right and it still gave me the same results. I also tried using
lua Humanoid.Jumping
Event and still no results.
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
Here’s the Client firing to Server:
Humanoid.StateChanged:connect(function(OldState, NewState)
if OldState == Enum.HumanoidStateType.Freefall and NewState == Enum.HumanoidStateType.Landed then
FootStepsEvent:FireServer(nil, nil, nil, true)
end
end)
Here is Server firing back to all Clients:
Event.OnServerEvent:Connect(function(Player, Foot, Material, Running, Jumping)
if Jumping == true then
Event:FireAllClients(Player)
end
end)
And here is the Client receiving the confirmation again to do it’s job:
FootStepsEvent.OnClientEvent:Connect(function(x)
repeat wait() until x.Character.Humanoid.FloorMaterial ~= Enum.Material.Air --[[ Here it waits for the player to land]]--
local x = x.Character
print("Player Landed")
local Particles = {}
Particles.Jump = ReplicatedStorage.Particles["Cloud Particles"].JumpParticle:Clone()
Particles.FootSteps = ReplicatedStorage.Particles["Cloud Particles"].FootStep:Clone()
local Cloud = Particles.Jump:Clone()
Cloud.Parent = x.HumanoidRootPart
Cloud.Position = Vector3.new(0,-2.6, 0)
Cloud.CloudParticle1:Emit(13)
Cloud.CloudParticle2:Emit(6.5)
Trash:AddItem(Cloud, 2)
end)
If I posted something incorrectly, then I apologize. This is my third post since I have joined this forum. If you feel I have done something inappropriate or wrong, Let me know. Thank you in advance for your support!
- Davie
Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.