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

The effect/particle doesn't show up?

Asked by 7 years ago
local plr = game.Players.LocalPlayer
local money = plr.leaderstats.Money
local effect = plr.leaderstats.Effect
local price = 400

script.Parent.MouseButton1Click:connect(function()
    if plr.leaderstats.Money.Value > (price) then
        plr.leaderstats.Money.Value = money.Value -(price)
        plr.leaderstats.Effect.Value = 2
        if plr.leaderstats.Effect.Value > 2 then
    wait (0.5)
        local epicfaces = Instance.new('ParticleEmitter')
        epicfaces.Parent = plr.Character.HumanoidRootPart
        epicfaces.Texture = 'rbxassetid://30327816'
        epicfaces.Rate = 3
        epicfaces.VelocitySpread = 30
        end
        end
end)

The effect is supposed to show up in the character, it's in a LocalScript in a TextButton. Sadly, the effect on the leaderboard goes up, but the effect doesn't show up. I honestly don't understand why it wont show up, I'm not good at LUA, neither at building. (lol)

0
Firstly, why is price in parenthesis..? Well it doesn't matter. Uhm. Make sure it's not transparent. Also add more peramitters. For example: epicafaces.LightEmission = Number animelover6446 41 — 7y
0
Didn't work. FishPlaysR 2 — 7y

1 answer

Log in to vote
0
Answered by
Shawnyg 4330 Trusted Badge of Merit Snack Break Moderation Voter Community Moderator
7 years ago

Well, the reason the particles do not appear is because of the conditional if statement. Take not that your 2nd if statement is WITHIN the first if statement, so anything in the 1st if statement may affect what happens in the 2nd one. For your 2nd one, you are checking to see if a value is greater than 2, however, in the line just before it, you set said value to be exactly 2. The script will see the value is 2 and will not continue to run, due to your if statement.

You can fix it by either removing line 9, or changing line 10. Whichever works in your preference.

Ad

Answer this question