1 | local ballcarrier = script.Parent |
2 | local Ball = game.Workspace:FindFirstChild( "Handle" ) |
3 |
4 | ballcarrier.Value = Ball.Parent.Parent |
I have a string value named ballcarrier in replicated storage, inside of it is this script. Ball is a tool and I'm trying to make it so it gets the player's name and puts it in the string value.
Ok so, put a script in the tool, then put this:
1 | local StringVal = game.ReplicatedStorage.StringVal --put your string value here |
2 | script.Parent.Equipped:Connect( function () |
3 | StringVal.Value = script.Parent.Parent.Name.. "'s ball" |
4 | end ) |
thats it, tell me if there is any problems.