How to optimize this script

Hello im trying to make this script better and optimized for security against exploiters can you help me?

game.Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(character)
		if game.MarketplaceService:PlayerOwnsAsset(player,000000) then
			character.Humanoid.WalkSpeed = 25
		end
	end)
end)

1 Like

Exploiters can’t hack server scripts, so I don’t think there’s any thing you can do since it’s already safe.

1 Like

As @ItzMeZeus_IGotHacked said,

The Script can’t be more optimized.

While there isn’t any security concern, it’s probably encouraged to wrap that function in a pcall, since it sends a request to the Roblox website, and can error.

Then is there a way to optimize the script?

Nope. Looks like it’s safe because it’s in a server script. Exploiters can’t hack server scripts.

Understood, thanks for your time

Though, watch out when using Remote Events, etc.
Exploiters can send messages through these things to the server.