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

Random title? The Question is in Desc

I am trying to make my script find players when they click a Gui but i don't know what i am suppose to type


script.Parent.MouseButton1Click:Connect(function()
	if "What do i put here?".Parent:FindFirstChild("Humanoid") then -- what do i type?
		local player = game.Players:GetPlayerFromCharacter(hit.Parent)
		game.ReplicatedStorage.TriggerCam:FireClient(player)
	end
end)

2 comments

0

sorry that the title is weird. it told me that i need a title and a question mark

0

You can get rid of that line completely. MouseButton1Click can only ever be clicked by the player, so you don't need to check for humanoid.

1 answer

script.Parent.MouseButton1Click:Connect(function(player) --this is the player
--Put code here
end)

Mark as answer if this answered your question.

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