the first and second and third script should make a trail on each body part of a player when they hold shift and go above 60 speed (like the flash.), although it starts the moment you press shift and not only from speed 60. and though its supposed to go away when going under a certain speed (or exactly 16), but it doesnt. (third script should do this)
Main script
local player = game.Players.LocalPlayer
local char = player.Character
local hum = char.Humanoid
local UserInputService = game:GetService("UserInputService")
local speed = game.ReplicatedStorage.Speed.Value
UserInputService.InputBegan:Connect(function(input, isTyping)
if isTyping then return end
if input.KeyCode == Enum.KeyCode.LeftShift then
speed = true
while speed == true do
if hum.WalkSpeed == 250 then break end
hum.WalkSpeed = hum.WalkSpeed + 1
wait()
end
end
end)
UserInputService.InputEnded:Connect(function(input, isTyping)
if isTyping then return end
if input.KeyCode == Enum.KeyCode.LeftShift then
speed = false
repeat
if speed == true then break end
hum.WalkSpeed = hum.WalkSpeed - 1
wait()
until
hum.WalkSpeed == 16
end
end)
Start trail
local player = game.Players.LocalPlayer
local character = player.Character or script.Parent
local humanoid = character.Humanoid
local remoteevent = game.ReplicatedStorage.RemoteEvent
if humanoid.WalkSpeed == 60 then
remoteevent:FireServer()
end
Make trail: (ServerScriptService)
local remoteevent = game.ReplicatedStorage.RemoteEvent
local trail = game.ServerStorage.Trail
remoteevent.OnServerEvent:Connect(function(player)
local character = player.Character
-- Trail 1
local trail1 = trail:Clone()
trail1.Parent = character
local attachment0 = Instance.new("Attachment", character.Head)
attachment0.Name = "TrailAttachment0"
local attachment1 = Instance.new("Attachment", character.HumanoidRootPart)
attachment1.Name = "TrailAttachment1"
trail1.Attachment0 = attachment0
trail1.Attachment1 = attachment1
-- Trail 2
local trail2 = trail:Clone()
trail2.Parent = character
local attachment2 = Instance.new("Attachment", character.RightUpperArm)
attachment2.Name = "TrailAttachment2"
local attachment3 = Instance.new("Attachment", character.RightHand)
attachment3.Name = "TrailAttachment3"
trail2.Attachment0 = attachment2
trail2.Attachment1 = attachment3
-- Trail 3
local trail3 = trail:Clone()
trail3.Parent = character
local attachment4 = Instance.new("Attachment", character.LeftUpperArm)
attachment2.Name = "TrailAttachment4"
local attachment5 = Instance.new("Attachment", character.LeftHand)
attachment3.Name = "TrailAttachment5"
trail3.Attachment0 = attachment4
trail3.Attachment1 = attachment5
-- Trail 4
local trail4 = trail:Clone()
trail4.Parent = character
local attachment6 = Instance.new("Attachment", character.LeftUpperLeg)
attachment6.Name = "TrailAttachment4"
local attachment7 = Instance.new("Attachment", character.LeftFoot)
attachment7.Name = "TrailAttachment5"
trail4.Attachment0 = attachment6
trail4.Attachment1 = attachment7
-- Trail 5
local trail5 = trail:Clone()
trail5.Parent = character
local attachment8 = Instance.new("Attachment", character.RightUpperLeg)
attachment6.Name = "TrailAttachment4"
local attachment9 = Instance.new("Attachment", character.RightFoot)
attachment7.Name = "TrailAttachment5"
trail5.Attachment0 = attachment8
trail5.Attachment1 = attachment9
end)
End trail (spoken part)
local player = game.Players.LocalPlayer
local character = player.Character or script.Parent
local humanoid = character.Humanoid
local remoteevent = game.ReplicatedStorage.RemoteEvent
while humanoid.WalkSpeed == 16 do
print(humanoid.WalkSpeed)
for i,v in pairs(character:GetChildren()) do
if v:IsA("Trail") then
v:Destroy()
end
end
wait()
end
remoteevent:FireServer()
location: