The Flash Script

Hey there!

I am a big fan of “The Flash” series, movie and the superhero in general, and recently i’ve been plaing some flash games in Roblox.

So i was wondering how i could do a Flash game myself, so i did some research and this was the best i could find:

https://gyazo.com/4de667373c3ff0cd6788c2bb27937186

But it was very bad to script and make changes so i now want to remake it.

Does anyone know how i can do it? All i’m looking for are 3 main features:

  • Flash trail (When you run above 50 speed or so)

  • Being able to change the lightning color (Server sided)

  • Being able to run using a keybind like shift (Which is what i used in the example)

If someone could help me i would greatly appreciate it.

Thanks! :slightly_smiling_face:

Depending on how you’d wanna implement it:

  • 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

1 Like

For the colors i was thinking of just pre defined colors like red, blue, yellow.

And also how would i do the trail itself?

Edit: I’ll have to leave for some time so i might take way longer to respond you

1 Like

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)
2 Likes

Hey, i’ll test it all out in some minutes then i’ll respond you back, thanks!