local inputservice = game:GetService("UserInputService")
local tweenservice = game:GetService("TweenService")
inputservice.InputBegan:Connect(function(input,controller)
if controller then return end
if input.KeyCode == Enum.KeyCode.P then
print"P has been pressed."
-- the part is cylinder and the CFrame don't work because it does not face the way I look!!!
local energywave = game.ReplicatedStorage.Part:Clone()
energywave.CFrame = script.Parent.LeftLowerArm.CFrame
energywave.Parent = game.Workspace
-- welding here
local weld = energywave.Weld
weld.Part0 = energywave
weld.Part1 = script.Parent.LeftLowerArm
-- tweening
local goal = {}
goal.Size = Vector3.new(100,3,3)
local tweeninfo = TweenInfo.new(2)
local tween = tweenservice:Create(energywave,tweeninfo,goal)
tween:Play()
end
end)
Ignore this, just placing your script in a code block
local inputservice = game:GetService("UserInputService") local tweenservice = game:GetService("TweenService") inputservice.InputBegan:Connect(function(input,controller) if controller then return end if input.KeyCode == Enum.KeyCode.P then print"P has been pressed." -- the part is cylinder and the CFrame don't work because it does not face the way I look!!! local energywave = game.ReplicatedStorage.Part:Clone() energywave.CFrame = script.Parent.LeftLowerArm.CFrame energywave.Parent = game.Workspace -- welding here local weld = energywave.Weld weld.Part0 = energywave weld.Part1 = script.Parent.LeftLowerArm -- tweening local goal = {} goal.Size = Vector3.new(100,3,3) local tweeninfo = TweenInfo.new(2) local tween = tweenservice:Create(energywave,tweeninfo,goal) tween:Play() end end)