The script is local and it's located in the starterGUI. I would really appreciate some help on this. Here's the script:
local me = game.Players.iiiAmericanLight local chr = me.Character local dg = Instance.new("ParticleEmitter") dg.Parent = chr:FindFirstChild("Right Arm") dg.Texture = game.ReplicatedStorage.DemonGlow.Texture dg.Size = game.ReplicatedStorage.DemonGlow.Size dg.Speed = game.ReplicatedStorage.DemonGlow.Speed dg.Color = game.ReplicatedStorage.DemonGlow.Color dg.LightEmission = game.ReplicatedStorage.DemonGlow.LightEmission dg.LightInfluence = game.ReplicatedStorage.DemonGlow.LightInfluence dg.Lifetime = game.ReplicatedStorage.DemonGlow.Lifetime dg.Rate = game.ReplicatedStorage.DemonGlow.Rate dg.LockedToPart = true local dm = Instance.new("Decal") dm.Name = "dm" dm.Parent = chr.Head dm.Texture = game.ReplicatedStorage.DemonMark.Texture dm.Color3 = game.ReplicatedStorage.DemonMark.Color3 local dt = Instance.new("Part") dt.Transparency = 1 dt.Size = game.ReplicatedStorage.MarkAuraB.Size dt.Parent = chr.Head dt.CanCollide = false local weld = Instance.new("Weld") weld.Part0 = dt weld.Part1 = chr.Head weld.C0 = weld.C0*CFrame.new(-0.3, -0.4, 0.45) weld.Parent = dt local ma = Instance.new("ParticleEmitter") ma.Parent = dt ma.Size = game.ReplicatedStorage.MarkAura.Size ma.Lifetime = game.ReplicatedStorage.MarkAura.Lifetime ma.Rate = game.ReplicatedStorage.MarkAura.Rate ma.Color = game.ReplicatedStorage.MarkAura.Color ma.Speed = game.ReplicatedStorage.MarkAura.Speed ma.LightEmission = game.ReplicatedStorage.MarkAura.LightEmission ma.LightInfluence = game.ReplicatedStorage.MarkAura.LightInfluence ma.Texture = game.ReplicatedStorage.MarkAura.Texture
Maybe you're referencing the character before it actually existed, as characters load after the player is added. Here's how I set my character variable each time the character loads or disappears.
local char = player.Character or player.CharacterAdded:Wait()
The error is on lines 1-2. You’re referencing your Player
object before it’s added and your Character
as well, you shouldn’t do it like this. You should instead use a Players.PlayerAdded
event to check if the player is you.
game:GetService('Players').PlayerAdded:Connect(function(plr) plr.CharacterAdded:Connect(function(char) if plr.UserId == 48617255 then -- grabbed your user id lol -- Do code. end end) end)
You can add before the object selected a WaitForChild()
example:
-- The objct you want is a part called : Blue **** part = game.Workspace:WaitForChild("Blue") -- WaitForChild() means that the script will continue to wait until he founds an object that correspond to ourdescription, in this case is : "Blue"
You need to do this only when you define an object, you Don't have to do this to define a size, position, ...