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

Where do I put this script? In witch folder and witch type of script?

Here is the script. I don't know where to put it (in witch folder and witch kind of script).

local plr = game.Players.LocalPlayer
local char = plr.Character
local hum = char:WaitForChild("Humanoid")
local UserInputService = game:GetService("UserInputService")

local leftWalk = Instance.new("Animation")
leftWalk.AnimationId = "rbxassetid://6046738829"

local rightWalk = Instance.new("Animation")
rightWalk.AnimationId = "rbxassetid://6046765944"

hum:LoadAnimation(leftWalk)
hum:LoadAnimation(rightWalk)

UserInputService.InputBegan:Connect(function(input)
	if input.KeyCode == Enum.KeyCode.D then
		print("Going Right")
		rightWalk:Play()
	elseif input.KeyCode == Enum.KeyCode.A then
		print("Going Left")
		leftWalk:Play()
	end
end)

UserInputService.InputEnded:Connect(function(input)
	if input.KeyCode == Enum.KeyCode.D then
		print("Animation Stop")
		rightWalk:Stop()
	elseif input.KeyCode == Enum.KeyCode.A then
		print("Animation Stop")
		leftWalk:Stop()
	end
end)

5 comments

0

If you don't know then you don't know what it does or how it does it.Start small and learn how to make thes kind of scripts yourself and you'll know

0

we know how it works but not where to put it

0

You can't know how it does what it does. Then you would know that it has to be a LocalScript because of the use of LocalPlayer

0

i know it was a localscript but not where to put it. Startercharacter mabye??

0

this is a site where people help each other, if you have mental illness.. unfortunately we cant help you here spjureeedd

1 answer

It's supposed to be in a LocalScript and at StarterCharacterScripts.

2 comments

0

Does not work

0

Is that a script you found somewhere?

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