GetPlayerFromCharacter Not working sometimes

local Remote = Instance.new("RemoteEvent", game.ReplicatedStorage)
Remote.Name = "SystemChat"

local part = game.Workspace["Island(Blue)"].Winpad 

local config = {
	Color = Color3.fromRGB(0, 13, 255), 
	Font = Enum.Font.Arial, 
	FontSize = Enum.FontSize.Size18
}

part.Touched:Connect(function(hit)
	local player = game.Players:GetPlayerFromCharacter(hit.Parent)
	local returnedtime = game.ReplicatedStorage.ReturnTimerValue:InvokeClient(player)
	local message = "[Server]: "..player.Name.." has beaten Blue in " .. returnedtime .. "!" 
	Remote:FireAllClients(message, config)
end)

asdfsagasdf

how do i fix this

part.Touched fires when any Part touches the Part. You need to put some checks in place to make sure it is a Part of the player. You will also want to put a debounce, since multiple parts of the player can touch the part and it can touch it many times in a row especially if the player is moving.

1 Like

oh i forgot about that thanks man!!!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.