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

How do I make Sparkles come off of Certain players Heads?

Asked by 8 years ago

I have been trying to make it so that whenever my fellow dev or I enter a server for the game, sparkles appear around our heads. So far, this is what I've got: function ifDevEntered(player) local dev = ( player.Name("DevSupremecy") or player.Name("Dev_Noobity") ) if dev then local sparkle = Instance.new("Sparkles") sparkle.Enabled = true sparkle.Parent(player.Character.Head) sparkle.SparkleColor(255, 0, 0) end end I think I've got the API calls right, so I think the problem's with the IF-THEN statement.

1 answer

Log in to vote
0
Answered by 8 years ago

LocalScript:

devs = {
    "name1",
    "name2",
    "name3",
    "name4"
}

plr = game.Players.LocalPlayer
wait(1)
local head = plr.Character:FindFirstChild("Head")
for i = 1, #devs do
    if (string.lower(plr.Name) == string.lower[devs[i])) then
        local sparkles = Instance.new("Sparkles",head)
        sparkles.SparkleColor = Color3.new(255/255, 0/255, 0/255)
    end
end

Script:

devs = {
    "name1",
    "name2",
    "name3",
    "name4"
}

game.Players.PlayerAdded:connect(function(plr)
    wait(1)
    local head = plr.Character:FindFirstChild("Head")
    for i = 1, #devs do
        if (string.lower(plr.Name) == string.lower(devs[i])) then
            local sparkles = Instance.new("Sparkles",head)
            sparkles.SparkleColor = Color3.new(255/255, 0/255, 0/255)
        end
    end
end)
0
What would I use the LocalScript for? DevSupremecy 10 — 8y
0
If you place the LocalScript inside StarterGui or StarterPack, the script will run each time the player is respawned. The regular script will only run after a player has joined the game, so if they died and respawned, the sparkles won't appear. fIash_drive 45 — 8y
Ad

Answer this question