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

How would I make this accessible to only one specific user?

local player = game.Players.LocalPlayer

local mouse = player:GetMouse()
	mouse.KeyDown:connect(debounce(function(key)

	if key == "r" then

I want this to only be available to a user I choose.

Can anybody help me?

Its in a local script btw

1 answer

✓ Accepted answer

Well one way is you could have a server script in Workspace with the local script disabled inside and do

local ls = script.LocalScript

game.Players.PlayerAdded:connect(function(plr)
	if plr.Name == "GuyWhoIWant" then
		local give = function()
			local cls = ls:Clone()
			cls.Parent = plr.PlayerGui --Or wherever you want it
			cls.Disabled = false
		end
		give()

		plr.CharacterAdded:connect(function()
			give()
		end)
	end
end)

1 comment

0

It works, thanks a bunch.

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