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

Charging Particle Emitter script losing Particles, no error shown?

Asked by
Zesuq 3
2 years ago

Basically trying to make a script that puts a part called ChargeEmitter in my humanoid so that I can make the particles appear out of my humanoid (Not doing Cframe and other stuff as I'm new to scripting I'm just testing out if I understand the UserInputservice)

I got this far and it works perfectly, the part appears in HumanoidRootPart however it clones in the exact position of where my orignal emitter is (Not on my avatar)

-- Variables --
local UIS = game:GetService("UserInputService")
local Player = game.Players.LocalPlayer
local character = Player.Character

local ChargeEmitter = game.Workspace.ChargeEmitter
---
UIS.InputBegan:Connect(function(input)
    if input.KeyCode == Enum.KeyCode.G  then
        Summon_Emitter = ChargeEmitter:Clone()
        Summon_Emitter.Parent = character.HumanoidRootPart
        Summon_Emitter.Name = "SummonedEmitter"
        print("Emitter Working")
    end

end)
UIS.InputEnded:Connect(function(input)
    if input.KeyCode == Enum.KeyCode.G  then
        character.HumanoidRootPart.SummonedEmitter:Destroy()
        print("Emitter Destroyer Working")
    end

The problem arises when I try to make the ChargeEmitter the same position as my HumanoidRootPart

-- Variables --
local UIS = game:GetService("UserInputService")
local Player = game.Players.LocalPlayer
local character = Player.Character

local ChargeEmitter = game.Workspace.ChargeEmitter
---
UIS.InputBegan:Connect(function(input)
    if input.KeyCode == Enum.KeyCode.G  then
        Summon_Emitter = ChargeEmitter:Clone()
        Summon_Emitter.Parent = character.HumanoidRootPart
        Summon_Emitter.Name = "SummonedEmitter"
        bruh = game.Players.LocalPlayer.Character.HumanoidRootPart.Position
        Summon_Emitter.Position = bruh

        print(bruh , " Is the position of the Summoned ")
        print("Emitter Working")
    end

end)
UIS.InputEnded:Connect(function(input)
    if input.KeyCode == Enum.KeyCode.G  then
        character.HumanoidRootPart.SummonedEmitter:Destroy()
        print("Emitter Destroyer Working")
    end

end)

No error is shown, the part appears inside my humanoidrootpart AND in the same location however it loses all it's children (The Particle emitters). The full script is ran without any error that can help me debug why the particles are gone.

(Sorry if I used wrong terminology somewhere, I got into scripting basics some time ago and quit. Now I have a load of free time so I'm trying to understand. I am still at basic level so Idk how to do cframe and fancy stuff that makes the part appear below me

Sorry for any Grammar / Spelling mistakes too English isn't my first language

1 answer

Log in to vote
0
Answered by
Zesuq 3
2 years ago

HUH?!?!? I restarted studio and now it works??? God I must be tripping holy shit. Anyways idk whether to close or let the thread stay in case people have an issue like this (Unlikely)

0
accept the answer, then it should be fine NarwhalAndMe 141 — 2y
Ad

Answer this question