I have a telekineis push animation that I want to add to my game but I do not know how to script it so the key binds are T + Click on Playe you want to use it on This is the animation to show what I mean: https://www.youtube.com/watch?v=rinRVGumuQk I want this to be able to used on other players not just something for the dummys to use.
insert a local script into startercharacterscripts then paste this
local player = game.Players.LocalPlayer repeat wait() until player.Character.Humanoid local humanoid = player.Character.Humanoid local mouse = player:GetMouse() local anim = Instance.new("Animation") anim.AnimationId = "http://www.roblox.com/asset/?id='' -- add your animation id mouse.KeyDown:connect(function(key) if key == "t" then local playAnim = humanoid:LoadAnimation(anim) playAnim:Play() end end)
accept this answer* if it helped!
local player = game.Players.LocalPlayer local char = player.Character local humanoid = char.Humanoid local mouse = player:GetMouse() local UIS = game:GetService("UserInputService") local track = instance.New("Animation") track.AnimationId = "http://www.roblox.com/asset/?id=' ' UIS.InputBegan:connect(function(Input) local MouseInput = Input.UserInputType -- Get all mouse inputs local KeyCode = Input.KeyCode -- Get all keyboard inputs if MouseInput = Enum.UserInputType.MouseButton1 then if KeyCode = Enum.KeyCode.T then if mouse.Target ~= nil and mouse.Target.Name = ' ' then --humanoid or player,character local = trackPlay = humanoid:LoadAnimation(track) trackPlay:Play()
you're gonna have to define player, character, etc., assuming you know how.