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

Every time I press Shift my script isnt activating the particles what am I doing wrong?

I am making a jetpack to attach on my player and I have scripted this

local player = game.Players.LocalPlayer repeat wait() until player.Character.Humanoid local humanoid = player.Character.Humanoid local mouse = player:GetMouse()

mouse.KeyDown:connect(function(key) if string.byte(key) == 48 then workspace.Jetpack.Fire2.Jetpack1 = Enabled workspace.Jetpack.Fire2.Jetpack2 = Enabled end end)

Every time I press Shift the particles don't activate and I get this error in the Output - ****Jetpack1 is not a valid member of Part

Any help is appreciated! :)

1 comment

0

Jetpack1 must not be a part of Fire2. Make sure it is a child of Fire2. Also, you can't set Jetpack1 and Jetpack2 to enabled. You have to write it like this: Jetpack1.Enabled = true

1 answer

Please, please, PLEASE use UIS - User Input Service! Key Down Is Deprecated!

local uis = game:GetService("UserInputService")

uis.InputBegan ............... -- you do the rest 

you might want to add a Waitforchild() infront of "dot jetpack1"

you definetly want to add 'WaitForChild()` infront of LocalPlayer

please be be sure to quit using key down and please use code block! it is the blue "lua" Circle you see when typing your request for help

hope this helps AltNature [Lua / Blenderer]#2828

1 comment

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