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

Trying to :GetPlayerFromCharacter in a normal script, however I can't?

So basically, I want it so when I click a brick, I can get the player.

script.Parent.ClickDetector.MouseClick:connect(function(plr)
	a = game.Players:GetPlayerFromCharacter(plr)
	a:Destroy()
end)

I have also tried this.

script.Parent.ClickDetector.MouseClick:connect(function(plr)
	local a = game.Players:GetPlayerFromCharacter(plr)
	a:Destroy()
end)

1 comment

0

use this instead "local character = plr.Character if character ~= nil then character:Destroy()"

1 answer

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