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

Getting name from gui click?

Alrighty, how would I get the players name, add a "sVelociraptor" to the end of their name and use it in a path?

function Down()
	local clicker = script.Parent.Parent.Parent.Name.."sVelociraptor"
game.Workspace.clicker.Head.Call:Play()
end
script.Parent.MouseButton1Click:connect(Down)

1 answer

You should be using a localscript anyways so use game.Players.LocalPlayer and index the Name Property.

local plr = game.Players.LocalPlayer

function Down()
	local clicker = plr.Name.."'s Velociraptor"
	workspace.clicker.Head.Call:Play()
end

script.Parent.MouseButton1Click:connect(Down)

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