Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to have flames coming from the player's feet only when running?

Asked by 6 years ago

Hey,

So I have a drink which increases run speed once you drink it, and I'd like to have a fire blaze effect from their feet but only when they run and only for 10 seconds.

I've tried the following

local replicatedStorage = game:GetService("ReplicatedStorage")
local flame = replicatedStorage.FireEmitter.Clone()

-- click to drink
fire.Parent = character.RightFoot

but it's always on, even when I'm not running, and it's only on one foot.

Thanks

3 answers

Log in to vote
0
Answered by 6 years ago

local replicatedStorage = game:GetService("ReplicatedStorage") local rightFlame = replicatedStorage.FireEmitter.Clone() local leftFlame = replicatedStorage.FireEmitter.Clone()

-- click to drink rightFlame.Enabled=false leftFlame.Enabled=false rightFlame.Parent = character.RightFoot leftFlame.Parent=character.LeftFood

player.character.running:connect(function(speed) if speed==16 then rightFlame.Enabled=true leftFlame.Enabled=true else rightFlame.Enabled=false leftFlame.Enabled=false end end)

if you didn't just use a free model and you have any experience with scripting you should be able to edit this to work

0
I'll get it to work, thanks :) RetroSpock 10 — 6y
0
Worked like a charm, thanks very much man! RetroSpock 10 — 6y
0
No problem! Earthkingiv 51 — 6y
Ad
Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

The thing is that you have not "finished" your code. You did not tell the script to remove the fire. I guess you did declare the variable character. But if not, you need to do that.

local replicatedStorage = game:GetService("ReplicatedStorage")
local flame = replicatedStorage.FireEmitter:Clone()

-- click to drink
fire.Parent = character.RightFoot
wait(10)
fire:Destroy()
0
This is not a solution. Mayk728 855 — 6y
0
What is the solution? :D RetroSpock 10 — 6y
Log in to vote
0
Answered by
Mayk728 855 Moderation Voter
6 years ago

The issue is that you did not specify Clone correctly. It's supposed to be written as Object:Clone().

local replicatedStorage = game:GetService("ReplicatedStorage")
local flame = replicatedStorage.FireEmitter:Clone()

-- click to drink
fire.Parent = character.RightFoot
0
Yeah I did that in my actual script... I just typed the example above for the sake of SH. How do I get it so the fire doesn't display when the player stops moving but displays when I'm running RetroSpock 10 — 6y

Answer this question