UIS.InputBegan:connect(function(input, typing)
if typing == false then
if input.UserInputType == Enum.UserInputType.Keyboard then
local keypressed = input.KeyCode
if keypressed == "g" then
local s = player.Character.Humanoid:LoadAnimation(Anim)
s:Play()
end
local lev = Instance.new("Part")
lev.Size = Vector3.new(1,1,1)
lev.CFrame = character["Torso"].CFrame
lev.Anchored = false
lev.Material = "Neon"
lev.Shape = "Ball"
lev.CanCollide = false
lev.Transparency = "0.5"
lev.Parent = game.Workspace
local bv = Instance.new("BodyVelocity")
bv.MaxForce = Ve######################## bv.Velocity = character["Torso"].CFrame.lookVector * 50
bv.Parent = lev
lev.Touched:connect(function(touch)
local hum = touch.Parent:FindFirstChild("Humanoid") or touch.Parent.Parent:FindFirstChild("Humanoid")
--- the rest is irrelevant so I didn't add it to this forum
I'm trying to load an animation but every time I move it spawns a ball even tho I don't hit the key like the player animation is linked to the script even tho i'm trying to play a custom animation
Explorer layout:
StarterPlayer
StarterCharacterScripts
LocalScript
Animation |