Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to put a player's name in a string value?

local ballcarrier = script.Parent
local Ball = game.Workspace:FindFirstChild("Handle")

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.

2 comments

0

Well how are you planning on find the player? When the tool is used? Or just automatically?...

0

It'd be when the player is holding the tool

1 answer

✓ Accepted answer

Ok so, put a script in the tool, then put this:

local StringVal = game.ReplicatedStorage.StringVal --put your string value here
script.Parent.Equipped:Connect(function()
	StringVal.Value = script.Parent.Parent.Name.. "'s ball"
end)

thats it, tell me if there is any problems.

1 comment

0

Thank you! I've been stumped on this for about 2 days, appreciate the help.

This discussion is preserved as it was. New answers, comments, and votes are closed.