Hey Everyone!
For an upcoming group game I would like to make jetpacks.
I have had them modelled but I was wondering how I would script them.
How would I move the character? How do I attach it to the player?
Any help would be appreciated
Hey Everyone!
For an upcoming group game I would like to make jetpacks.
I have had them modelled but I was wondering how I would script them.
How would I move the character? How do I attach it to the player?
Any help would be appreciated
Not sure if this would help, but maybe look into using tweenservice?
I suggest using Body movers to move the character.
How would I go about body movers? I don’t usually work with positional stuff
You could put the model in a tool and use a VectorForce:
VectorForce.Force = Vector3.new(0,5000,0)
Tool.Activated:Connect(function()
VectorForce.Enabled = true
wait(1)
VectorForce.Enabled = false
end)
Would I also be able to use a keybind with that?
For sure. You can bind it with ContextActionService:
local ContextActionService = game:GetService("ContextActionService")
local function doAction(actionName, inputState, inputObject)
if actionName == "ActivateJetpack" then
if inputState == Enum.UserInputState.Begin then
VectorForce.Enabled = true
elseif inputState == Enum.UserInputState.End then
VectorForce.Enabled = false
end
end
end
Tool.Equipped:Connect(function()
ContextActionService:BindAction("ActivateJetpack", doAction, true, Enum.KeyCode.E)
end)
Tool.Unequipped:Connect(function()
ContextActionService:UnbindAction("ActivateJetpack")
VectorForce.Enabled = false
end)