can someone tell me whats wrong with this short script?
Please make your question title relevant to your question content. It should be a one-sentence summary in question form.
1 | local plyr = game.Players:FindFirstChild(game.Workspace.Goals.SoccerBall.Kicker.Value) |
2 | game.Workspace.Goals.SoccerBall.Kicker.Changed:connect( function () |
3 | script.Parent.Parent.goalmusic.SoundId = "rbxassetid://" .. plyr.hiddenstats.Value.Value |
if a player touches the soccer ball his name goes on the Kicker.Value (this works)
I use the Kicker.Value to find the player using game.Players:FindFirstChild(game.Workspace.Goals.SoccerBall.Kicker.Value)
then I initiate the function after the Kicker.Value is changed
then I make the script.Parent.Parent.GoalMusic.SoundID equal to the hidden stats.Value.Value of the player who just kicked the soccer ball
did I do anything wrong?