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

Why is this failing to get a playermouse?

for _,v in pairs(game.Players:GetChildren()) do
		thing = script.AnnounceGui:clone()
		thing.Frame.Position = UDim2.new(v:GetMouse().ViewSizeX/200,0,v:GetMouse().ViewSizeY/200,0)
		thing.Parent = v.PlayerGui
	end

It threw an error saying it couldn't index a nil value with v:GetMouse. But I'm definately talking about players with v because I'm iterating through the players. Why is this going wrong?

1 answer

:GetMouse() only works from a localscript, and it will only get the mouse of the player that the script is in

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