You could use a ServerScript to detect when a Humanoid’s Walkspeed changes using the Running event, then check if it’s current speed is above 50 to Enable/Disable the trail
Have the client side deal with the keybinds (Shift) using UserInputService to be able to sprint, then send a RemoteEvent to change the WalkSpeed from the client, to the server
Not sure about the changing of the lightning color, but maybe every time you sprint it chooses a random color?
These are just my thoughts on how you could implement it
You can let the Server Script handle the Trail Creation, and detection to disable/enable it using a CharacterAdded event (Just realized Trails require Attachments as well so you’d need to create those)
Maybe something like this would do?
local Trail = game.ReplicatedStorage.FlashTrail --The trail should have an Enabled property set to false
game.Players.PlayerAdded:Connect(function(Player)
Player.CharacterAdded:Connect(function(Character)
local HRP = Character:WaitForChild("HumanoidRootPart")
local Humanoid = Character:WaitForChild("Humanoid")
local Attachment0 = Instance.new("Attachment")
Attachment.Parent = HRP
local TrailClone = Trail:Clone()
TrailClone.Parent = HRP
TrailClone.Attachment0 = HRP
TrailClone.Attachment1 = HRP
Humanoid.Running:Connect(function(CurrentSpeed)
if CurrentSpeed >= 50 then
TrailClone.Enabled = true
else
TrailClone.Enabled = false
end
end)
end)
end)