what? sorry i dont understand. what do you mean?
if you load the fingerprints from the client the server will not be able to delete them, what you should do is delete them in the client, it should be noted that as you apparently did not load the fingerprints on the server because the other clients will not see them, so if you delete them in the client there is no problem.
well yes but my problem is it wont delete in the client
Iâm a moron with English⌠on the server what you should do is to send the event to all the other clients and then from a local script detect the event and delete the traces.
so u want me to swap what i did with the local script to the serverscript?
heres what it looks on the server
and heres the client
this: step1: in the local function of clearOnDeath
send a remote event to the server, then the server detects it and spawns a function that waits for the event Humanoid.Died
then when it detects it sends a remote event to all the local players and the name of the player that died, the client detects the event, verifies that the player that died is the same as the one that detects the event and then deletes his steps, easy
well, could you do this? i dont really understand.
I didnât realize the footprints were on the server
Make a folder for footprints and then we will make a folder in that folder for each player. The playerâs folder will contain all of their own footprints. This way, we donât have to use any complicated communication between the client and server and we can do everything from one script.
I also included a function called getPlrFolder so you can use this to put the footprints of the player in their personal folder.
local folder = game.Workspace.footPrints -- folder to contain everything
game.Players.PlayerAdded:Connect(function(plr) -- fires when a player joins
local plrFolder = Instance.new("Folder", folder) -- create a personal folder for that player
plrFolder.Name = plr.Name -- name that folder to the players name so its easier in the future
plr.CharacterAdded:Connect(function(char) -- fires when their character loads
local humanoid = char:WaitForChild("Humanoid") -- waits for their humanoid
humanoid.Died:Wait() -- waits until the humanoid dies
plrFolder:ClearAllChildren() -- clear everything in the player's folder
end)
end)
function getPlrFolder(name) -- function to get a player's folder given their name
return folder:FindFirstChild(name) -- searches for a folder of the player's name. this works because we set it the folder to the player's name before.
end
they are still there even with this, they are not on the server but on the client side they are still there.
i looked at the folders and they are actually not even filling up with the footprints.
i included the getPlrFolder function so you could script the footprints appearing in the playerâs folders
friend simply deletes the fingerprints from the client
tell me what part you donât understand I donât plan to make code just like that without you telling me what part you need.
the part where it finds out which player is which
ok so i made it so the footprints go inside the player folder, but the footprints still occur on the client.
ok it works now but after the player dies the footpritns dont come back
heres the scripts i used
local:
local folder = game.Workspace.FootprintFolder â folder to contain everything
local plr = game.Players.LocalPlayer
local plrname = plr.Name
local char = plr.Character or plr.CharacterAdded:Wait()
local remote = game.ReplicatedStorage.death
local plrFolder = workspace.FootprintFolder:WaitForChild(plrname)
remote.OnClientEvent:Connect(function()
local humanoid = char:WaitForChild(âHumanoidâ) â waits for their humanoid
humanoid.Died:Wait() â waits until the humanoid dies
plrFolder:ClearAllChildren() â clear everything in the playerâs folder
end)
server:
local folder = game.Workspace.FootprintFolder â folder to contain everything
local remote = game.ReplicatedStorage.deathgame.Players.PlayerAdded:Connect(function(plr) â fires when a player joins
local plrFolder = Instance.new(âFolderâ, folder) â create a personal folder for that player
plrFolder.Name = plr.Name â name that folder to the players name so its easier in the futureplr.CharacterAdded:Connect(function(char) â fires when their character loads
local humanoid = char:WaitForChild(âHumanoidâ) â waits for their humanoid
humanoid.Died:Wait() â waits until the humanoid dies
plrFolder:ClearAllChildren() â clear everything in the playerâs folder
remote:FireClient(plr)
end)
end)function getPlrFolder(name) â function to get a playerâs folder given their name
return folder:FindFirstChild(name) â searches for a folder of the playerâs name. this works because we set it the folder to the playerâs name before.
end
main local:
â#Services
local tweenService = game:GetService(âTweenServiceâ)
local debris = game:GetService(âDebrisâ)
local players = game:GetService(âPlayersâ)
local runService = game:GetService(âRunServiceâ)
local replicatedStorage = game:GetService(âReplicatedStorageâ)
local player = game.Players.LocalPlayer
local playername = player.Name
â#Objects
local folder = workspace.FootprintFolder:WaitForChild(playername)
local mainFolder = replicatedStorage.Footsteps
local remoteEvent = mainFolder.FootstepsEvent
local configuration = mainFolder.FootstepsConfigâ#Constants
local fadeTime = configuration.FadeTime.Value
local frequency = configuration.Frequency.Value
local viewOtherPrints = configuration.ViewOtherPrints
local useFloorColor = configuration.UseFloorColor
local useFootSize = configuration.UseFootSize
local particlesOnMaterial = configuration.ParticlesOnMaterial
local notMoving = Vector3.new(0, 0, 0)
local defaultParticleFade = 0.1â#Functions
local RayCast = function(origin,target,ignorelist)
local params = RaycastParams.new()
params.FilterType = Enum.RaycastFilterType.Exclude
params.FilterDescendantsInstances = (ignorelist)
local raycast = workspace:Raycast(origin,target,params)if raycast then
return raycast
else
return nil
end
end
local createFootPrint = function(leg, hitnormal, hitPosition,hit,hitmaterial)
local footprint = script.Footprint:Clone()
footprint.Parent = folder
footprint.CFrame = CFrame.new(hitPosition, footprint.Position+hitnormal)
footprint.Orientation = leg.Parent.HumanoidRootPart.Orientationif useFootSize.Value == true then
footprint.Size = Vector3.new(leg.Size.X, 0.1, leg.Size.Z)
end
if useFloorColor.Value == true then
if tostring(hit.Name) == âTerrainâ then
footprint.Color = workspace.Terrain:GetMaterialColor(hitmaterial)
else
footprint.BrickColor = hit.BrickColor
end
end
if particlesOnMaterial.Value == true then
local player = game.Players.LocalPlayer
local findParticle = particlesOnMaterial:FindFirstChild(hitmaterial)
if findParticle then
local particle = findParticle:Clone()
particle.Parent = footprint
local waittime = particle:FindFirstChild(âHowLongToLastâ).Value or 0.5
coroutine.wrap(function()
particle.Enabled = true
task.wait(waittime)
particle.Enabled = false
task.wait(particle.Lifetime.Max)
particle:Destroy()
end)()
end
end
return footprint
end
local tween = function(t, instance, properties, style, direction, waitUntilDone)
local info = TweenInfo.new(t, Enum.EasingStyle[style], Enum.EasingDirection[direction])
local tween = tweenService:Create(instance,info,properties)
tween:Play()
if waitUntilDone == true then
tween.Completed:Wait()
end
endâ#Event
replicatedStorage.Footsteps.FootstepsEvent.OnClientEvent:Connect(function(char)
repeat task.wait() until char
local startFootprints = true
local humanoid = char:FindFirstChild(âHumanoidâ) or char:WaitForChild(âHumanoidâ, 5)while startFootprints == true do
task.wait()
if humanoid.MoveDirection ~= notMoving then
local leftLeg = char:FindFirstChild(âLeft Legâ) or char.LeftFoot
local rightLeg = char:FindFirstChild(âRight Legâ) or char.RightFootlocal raycastr = RayCast(rightLeg.Position, leftLeg.CFrame.UpVector * -3, {char, folder}) if raycastr then local hit, hitnormal, hitposition, hitmaterial = raycastr.Instance, raycastr.Normal, raycastr.Position, raycastr.Material if hit.Parent ~= folder then local rightprint = createFootPrint(rightLeg,hitnormal,hitposition,hit,hitmaterial) tween(fadeTime, rightprint, {Transparency = 1}, "Linear", "Out", false) debris:AddItem(rightprint,fadeTime*2) end end task.wait(frequency) local raycastl = RayCast(leftLeg.Position, leftLeg.CFrame.UpVector * -3, {char, folder}) if raycastl then local hit, hitnormal, hitposition, hitmaterial = raycastl.Instance, raycastl.Normal, raycastl.Position, raycastl.Material if hit.Parent ~= folder then local leftprint = createFootPrint(leftLeg,hitnormal,hitposition,hit,hitmaterial) tween(fadeTime, leftprint, {Transparency = 1}, "Linear", "Out", false) debris:AddItem(leftprint, fadeTime*2) end end task.wait(frequency) end
end
end)
main server:
local players = game:GetService(âPlayersâ)
local serverScriptService = game:GetService(âServerScriptServiceâ)
local replicatedStorage = game:GetService(âReplicatedStorageâ)â#Instances
local remote = Instance.new(âRemoteEventâ)
local folder = replicatedStorage.Footsteps
local walkingremote = Instance.new(âRemoteEventâ)â#Setup
script.Parent = serverScriptService
remote.Parent = folder
remote.Name = âFootstepsEventâ
walkingremote.Parent = folder
walkingremote.Name = âWalkingRemoteâ
script.FootstepsConfig.Parent = folderlocal workspacefolder = Instance.new(âFolderâ, workspace)
workspacefolder.Name = âFootprintFolderâgame.Players.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function(char)
repeat wait() until char and folder.FootstepsConfiglocal viewOthersPrints = folder.FootstepsConfig.ViewOtherPrints if viewOthersPrints.Value == true then remote:FireAllClients(char) else remote:FireClient(plr, char) end char.Humanoid.Died:Connect(function() for _, footprint in ipairs(workspacefolder:GetChildren()) do footprint:Destroy() end end)
end)
end)walkingremote.OnServerEvent:Connect(function(plr, movement)
local char = plr.Character
char.Humanoid:Move(movement)
end)
in every local script you must have a Plr variable, then when the server detects that a player died it sends the remote event to all the players with a parameter (the player that died) then the client detects the event and verifies if the player that died is the client, if it is the client then it eliminates the client steps.
lol i fixed it for him guys, im a scripter for him and just redid it all
(funkymonkey is silly guy who make more scripts for 1 thing then he has to)
Answer for anyone having the problem:
The system I used was a single server script inside StarterCharacterScripts, hereâs a flowchart of how it worked so I donât torture you with my poor communication skills:
This is how itâd work in a while loop.
I used RunService, so itâs slightly different.
The difference is, if the raycast result doesnât exist, it just hits a dead end, and runservice will loop back for you without actually making you wait the X amount of seconds at the beginning of the loop.