So I'm new to scripting on ROBLOX, and I'm trying to code a button to do a player animation, but keep running into an error saying player is not a valid member of workspace. I'm not sure how to fix it. Here is my LocalScript code:
script.parent.MouseButton1Click:Connect(function() game.ReplicatedStorage.RemoteEvent:FireServer("01646611372") end)
and here is my workspace code:
game.ReplicatedStorage.RemoteEvent.OnServerEvent:Connect(function(player,animationID) local animation = Instance.new("Animation") animation.AnimationId = "http://www.roblox.com/Asset?ID="..animationID local LoadedAnimation = game.Workspace(player.Name).Humaniod.LoadAnimation(animation) LoadedAnimation:Play() end)
if I could get an answer to this, and an explanation as to what to do to prevent this in the future, I'd Really appreciate it. Thanks.
Line 1 local script is script.Parent
not script.parent
Line 5 server script is game.Workspace[player.Name]
with square brackets