Gui made by me and then transferred to script with a plugin, I tested the gui version and it worked fine, but when I use the scripted one (After converting with plugin.) One simple line wont let me play the animation at all.
Here is the script pls help :(
-- no stel pls -- Made by MrNotSoBaddy local Animation = Instance.new("ScreenGui") local TextButton = Instance.new("TextButton") --Properties: Animation.Name = "Animation" Animation.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
TextButton.Parent = Animation TextButton.BackgroundColor3 = Color3.new(1, 1, 1) TextButton.Position = UDim2.new(0, 27, 0, 331) TextButton.Size = UDim2.new(0, 120, 0, 30) TextButton.Font = Enum.Font.SourceSans TextButton.Text = "Animation" TextButton.TextSize = 14 -- Scripts: function SCRIPT_WOBO83_FAKESCRIPT() -- TextButton.LocalScript getfenv().script = Instance.new('LocalScript', TextButton)
local animation = Instance.new("Animation") animation.AnimationId = "http://www.roblox.com/Assest?ID=2561376219" local trackanimation = nil local playability = true function playAnimation(AnimationSource) if playability == true then local plr = game.Players.LocalPlayer trackanimation = plr.Character.Humanoid:LoadAnimation(animation) trackanimation.KeyframeReached:connect(function() print('Working') end) trackanimation:Play() end end script.Parent.MouseButton1Click:connect(playAnimation)
end coroutine.resume(coroutine.create(SCRIPT_WOBO83_FAKESCRIPT))
local animation = Instance.new("Animation") animation.AnimationId = "http://www.roblox.com/Assest?ID=2561376219" local trackanimation = nil local playability = true function playAnimation(AnimationSource) if playability == true then local plr = game.Players.LocalPlayer trackanimation = plr.Character.Humanoid:LoadAnimation(animation) trackanimation.KeyframeReached:connect(function() print('Working') end) trackanimation:Play() end end script.Parent.MouseButton1Click:connect(playAnimation)
the variable animation needs a parent. Do this instead
local animation = Instance.new("Animation", x) -- x can be the object that you are adding the animation to or even in the workspace animation.AnimationId = "http://www.roblox.com/Assest?ID=2561376219" local trackanimation = nil local playability = true function playAnimation(AnimationSource) if playability == true then local plr = game.Players.LocalPlayer trackanimation = plr.Character.Humanoid:LoadAnimation(animation) trackanimation.KeyframeReached:connect(function() print('Working') end) trackanimation:Play() end end script.Parent.MouseButton1Click:connect(playAnimation)
-- no stel pls -- Made by MrNotSoBaddy local Animation = Instance.new("ScreenGui") local TextButton = Instance.new("TextButton") Properties: Animation.Name = "Animation" Animation.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
TextButton.Parent = Animation TextButton.BackgroundColor3 = Color3.new(1, 1, 1) TextButton.Position = UDim2.new(0, 27, 0, 331) TextButton.Size = UDim2.new(0, 120, 0, 30) TextButton.Font = Enum.Font.SourceSans TextButton.Text = "Animation" TextButton.TextSize = 14 -- Scripts: function SCRIPT_WOBO83_FAKESCRIPT() -- TextButton.LocalScript getfenv().script = Instance.new('LocalScript', TextButton) local animation = Instance.new("Animation", x) -- x can be the object that you are adding the animation to or even in the workspace animation.AnimationId = "http://www.roblox.com/Assest?ID=2561376219"
local trackanimation = nil local playability = true function playAnimation(AnimationSource) if playability == true then local plr = game.Players.LocalPlayer trackanimation = plr.Character.Humanoid:LoadAnimation(animation) trackanimation.KeyframeReached:connect(function() print('Working') end) trackanimation:Play() end end script.Parent.MouseButton1Click:connect(playAnimation)
-- is this right?