Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Particle emitter isn't enabling with my script can anybody help?

My particle emitter isn't enabling when I tell it to, i'm trying to make a dodging script and this is it so far but my problem is the particle emitter isn't enabling, i already tested if it works.

this is my first script which is just firing the code in the server when I press left shift

local debounce = false

game:GetService("UserInputService").InputBegan:connect(function(inputObject, gameProcessedEvent)
    if inputObject.KeyCode == Enum.KeyCode.LeftShift and debounce == false then
	debounce = true
       game.ReplicatedStorage.Dodge:FireServer()

		wait(1.5)
	debounce = false
    end 

end)

and this is my last script where it's supposed to anchor the player and enable a particle around them (it's a circle) but this is the problem, there aren't any error messages.

game.ReplicatedStorage.Dodge.OnServerEvent:Connect(function(player)
	player.Character.Humanoid.RootPart.Anchored = true
	game.StarterPlayer.StarterCharacterScripts.Part.Attachment.ParticleEmitter.Enabled = true
	wait(.2)
	player.Character.Humanoid.RootPart.Anchored = false
	game.StarterPlayer.StarterCharacterScripts.Part.Attachment.ParticleEmitter.Enabled = false
end)

2 comments

0

I checked and there's no RootPart in Humanoid. I think it's just HumanoidRootPart that you're looking for.

0

that part of the script already works it's the particle emitter that doesn't work

1 answer

✓ Accepted answer

Your problem is that you're referencing the server's storage of this particle emitter, and not the actual players particle emitter. I'm also seeing the issue of you having a part inside of a script-only folder.

My proposed fix would be to move your particle emitter to the players root part (or a part inside of the player), and then reference said part in order to activate the particle emitter.

Here's an example:

player.Character.HumanoidRootPart.ParticleEmitter.Enabled = true

This discussion is preserved as it was. New answers, comments, and votes are closed.