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

Hi! i am modifying a script and i want to know what is wrong with it.. can someone help me?

The script (not mine, credit to: G2_funny)

script.Parent.Activated:Connect(function()
	if script.Parent.Text == "Sprint" then 
		script.Parent.Text = "Walk"
		game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 30
		game.Players.LocalPlayer.Character["Garbage Bin"].Handle.Transparency = 0
		game.Players.LocalPlayer.Character.Animate.walk.WalkAnim.AnimationId = ('rbxassetid://5529293776')
		game.Players.LocalPlayer.Character.Animate.idle.Animation1.AnimationId = ("rbxassetid://5529293776")
  _G.PlayAnim:Play()
	else
		script.Parent.Text = "Sprint"
		game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 16
		game.Players.LocalPlayer.Character["Garbage Bin"].Handle.Transparency = 1
		game.Players.LocalPlayer.Character.Animate.idle.Animation1.Character.Animate.walk.WalkAnim.AnimationId = ('rbxassetid://5516799190')
		game.Players.LocalPlayer.Character.Animate.idle.Animation1.AnimationId = ("rbxassetid://5516757431")
		_G.PlayAnim:Stop()
	end
end)

The problem is its the animation is not unloading (Stopping).

1 comment

0

it is a local script btw

1 answer

You cant change the Char from the Local player because the player is in the Workspace.

1 comment

0

I think...

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