Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

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

Asked by
ZIRFAL3 17
4 years ago

The script (not mine, credit to: G2_funny)

01script.Parent.Activated:Connect(function()
02    if script.Parent.Text == "Sprint" then
03        script.Parent.Text = "Walk"
04        game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 30
05        game.Players.LocalPlayer.Character["Garbage Bin"].Handle.Transparency = 0
06        game.Players.LocalPlayer.Character.Animate.walk.WalkAnim.AnimationId = ('rbxassetid://5529293776')
07        game.Players.LocalPlayer.Character.Animate.idle.Animation1.AnimationId = ("rbxassetid://5529293776")
08  _G.PlayAnim:Play()
09    else
10        script.Parent.Text = "Sprint"
11        game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 16
12        game.Players.LocalPlayer.Character["Garbage Bin"].Handle.Transparency = 1
13        game.Players.LocalPlayer.Character.Animate.idle.Animation1.Character.Animate.walk.WalkAnim.AnimationId = ('rbxassetid://5516799190')
14        game.Players.LocalPlayer.Character.Animate.idle.Animation1.AnimationId = ("rbxassetid://5516757431")
15        _G.PlayAnim:Stop()
16    end
17end)

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

0
it is a local script btw ZIRFAL3 17 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

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

0
I think... taddmichael 0 — 4y
Ad

Answer this question